home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
99%
| dexvert
| Texinfo Document (document/texInfo)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| LaTeX document text
| default
| |
99%
| file
| TeX document text
| default
| |
98%
| file
| LaTeX document, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 64 6f 63 75 6d 65 6e | 74 73 74 79 6c 65 5b 76 |\documen|tstyle[v|
|00000010| 65 72 62 66 69 6c 65 2c | 62 6c 6f 63 6b 70 61 72 |erbfile,|blockpar|
|00000020| 2c 64 65 73 63 5d 7b 61 | 72 74 69 63 6c 65 7d 0a |,desc]{a|rticle}.|
|00000030| 5c 62 65 67 69 6e 7b 64 | 6f 63 75 6d 65 6e 74 7d |\begin{d|ocument}|
|00000040| 0a 0a 25 20 54 6d 20 76 | 65 72 73 69 6f 6e 20 6e |..% Tm v|ersion n|
|00000050| 75 6d 62 65 72 0a 5c 69 | 6e 70 75 74 7b 76 65 72 |umber.\i|nput{ver|
|00000060| 73 69 6f 6e 7d 0a 25 20 | 53 6f 6d 65 20 6c 6f 67 |sion}.% |Some log|
|00000070| 6f 73 0a 5c 64 65 66 5c | 74 6d 7b 5c 62 66 20 74 |os.\def\|tm{\bf t|
|00000080| 6d 7d 0a 5c 64 65 66 5c | 43 7b 5c 62 66 20 43 7d |m}.\def\|C{\bf C}|
|00000090| 0a 5c 64 65 66 5c 70 61 | 73 63 61 6c 7b 5c 62 66 |.\def\pa|scal{\bf|
|000000a0| 20 50 61 73 63 61 6c 7d | 0a 0a 25 20 57 69 64 74 | Pascal}|..% Widt|
|000000b0| 68 20 6f 66 20 64 65 73 | 63 72 69 70 74 69 6f 6e |h of des|cription|
|000000c0| 20 63 6f 6c 75 6d 6e 20 | 69 6e 20 74 61 62 75 6c | column |in tabul|
|000000d0| 61 72 20 65 6e 76 69 72 | 6f 6e 6d 65 6e 74 73 2e |ar envir|onments.|
|000000e0| 0a 5c 6e 65 77 6c 65 6e | 67 74 68 7b 5c 64 65 73 |.\newlen|gth{\des|
|000000f0| 63 77 69 64 74 68 7d 0a | 5c 73 65 74 6c 65 6e 67 |cwidth}.|\setleng|
|00000100| 74 68 7b 5c 64 65 73 63 | 77 69 64 74 68 7d 7b 30 |th{\desc|width}{0|
|00000110| 2e 37 5c 74 65 78 74 77 | 69 64 74 68 7d 0a 5c 73 |.7\textw|idth}.\s|
|00000120| 65 74 63 6f 75 6e 74 65 | 72 7b 74 6f 63 64 65 70 |etcounte|r{tocdep|
|00000130| 74 68 7d 7b 32 7d 0a 0a | 25 20 41 20 27 6c 69 73 |th}{2}..|% A 'lis|
|00000140| 74 69 6e 67 27 20 65 6e | 76 69 72 6f 6e 6d 65 6e |ting' en|vironmen|
|00000150| 74 2e 0a 5c 6e 65 77 65 | 6e 76 69 72 6f 6e 6d 65 |t..\newe|nvironme|
|00000160| 6e 74 7b 6c 69 73 74 69 | 6e 67 7d 7b 5c 73 6d 61 |nt{listi|ng}{\sma|
|00000170| 6c 6c 5c 62 65 67 69 6e | 7b 66 6c 75 73 68 6c 65 |ll\begin|{flushle|
|00000180| 66 74 7d 7d 7b 5c 65 6e | 64 7b 66 6c 75 73 68 6c |ft}}{\en|d{flushl|
|00000190| 65 66 74 7d 7d 0a 0a 5c | 74 69 74 6c 65 7b 7b 5c |eft}}..\|title{{\|
|000001a0| 74 6d 7d 20 7b 5c 70 61 | 73 63 61 6c 7d 20 73 75 |tm} {\pa|scal} su|
|000001b0| 70 70 6f 72 74 20 55 73 | 65 72 20 4d 61 6e 75 61 |pport Us|er Manua|
|000001c0| 6c 20 5c 5c 20 7b 5c 4c | 61 72 67 65 20 76 65 72 |l \\ {\L|arge ver|
|000001d0| 73 69 6f 6e 20 7b 5c 76 | 65 72 73 69 6f 6e 7d 7d |sion {\v|ersion}}|
|000001e0| 7d 0a 5c 61 75 74 68 6f | 72 7b 43 2e 20 76 61 6e |}.\autho|r{C. van|
|000001f0| 20 52 65 65 75 77 69 6a | 6b 20 5c 5c 20 44 65 6c | Reeuwij|k \\ Del|
|00000200| 66 74 20 55 6e 69 76 65 | 72 73 69 74 79 20 6f 66 |ft Unive|rsity of|
|00000210| 20 54 65 63 68 6e 6f 6c | 6f 67 79 7d 0a 5c 6d 61 | Technol|ogy}.\ma|
|00000220| 6b 65 74 69 74 6c 65 0a | 5c 73 65 63 74 69 6f 6e |ketitle.|\section|
|00000230| 7b 49 6e 74 72 6f 64 75 | 63 74 69 6f 6e 7d 0a 54 |{Introdu|ction}.T|
|00000240| 68 69 73 20 6d 61 6e 75 | 61 6c 20 70 72 6f 76 69 |his manu|al provi|
|00000250| 64 65 73 20 74 68 65 20 | 6e 65 63 65 73 73 61 72 |des the |necessar|
|00000260| 79 20 69 6e 66 6f 72 6d | 61 74 69 6f 6e 20 74 6f |y inform|ation to|
|00000270| 20 75 73 65 20 74 68 65 | 20 7b 5c 70 61 73 63 61 | use the| {\pasca|
|00000280| 6c 7d 0a 74 65 6d 70 6c | 61 74 65 73 20 6f 66 20 |l}.templ|ates of |
|00000290| 7b 5c 74 6d 7d 2e 0a 54 | 68 65 20 69 6e 66 6f 72 |{\tm}..T|he infor|
|000002a0| 6d 61 74 69 6f 6e 20 69 | 73 20 73 70 6c 69 74 20 |mation i|s split |
|000002b0| 69 6e 20 74 77 6f 20 70 | 61 72 74 73 3a 20 69 6e |in two p|arts: in|
|000002c0| 20 73 65 63 74 69 6f 6e | 20 5c 72 65 66 7b 73 65 | section| \ref{se|
|000002d0| 63 3a 71 75 69 63 6b 69 | 6e 74 72 6f 7d 0a 61 20 |c:quicki|ntro}.a |
|000002e0| 71 75 69 63 6b 20 60 63 | 6f 6f 6b 62 6f 6f 6b 27 |quick `c|ookbook'|
|000002f0| 20 64 65 73 63 72 69 70 | 74 69 6f 6e 20 6f 66 20 | descrip|tion of |
|00000300| 74 68 65 20 75 73 65 20 | 6f 66 20 74 68 65 20 74 |the use |of the t|
|00000310| 65 6d 70 6c 61 74 65 73 | 20 69 73 20 67 69 76 65 |emplates| is give|
|00000320| 6e 2e 0a 49 6e 20 74 68 | 65 20 72 65 6d 61 69 6e |n..In th|e remain|
|00000330| 69 6e 67 20 73 65 63 74 | 69 6f 6e 73 20 61 20 64 |ing sect|ions a d|
|00000340| 65 74 61 69 6c 65 64 20 | 64 65 73 63 72 69 70 74 |etailed |descript|
|00000350| 69 6f 6e 20 6f 66 20 74 | 68 65 20 74 65 6d 70 6c |ion of t|he templ|
|00000360| 61 74 65 73 20 69 73 20 | 67 69 76 65 6e 2e 0a 5c |ates is |given..\|
|00000370| 70 61 72 0a 54 68 65 20 | 64 65 66 69 6e 69 74 69 |par.The |definiti|
|00000380| 6f 6e 73 20 61 72 65 20 | 64 65 73 63 72 69 62 65 |ons are |describe|
|00000390| 64 20 75 73 69 6e 67 20 | 61 20 7b 5c 70 61 73 63 |d using |a {\pasc|
|000003a0| 61 6c 7d 20 74 79 70 65 | 20 73 70 65 63 69 66 69 |al} type| specifi|
|000003b0| 63 61 74 69 6f 6e 2c 0a | 62 75 74 20 77 69 74 68 |cation,.|but with|
|000003c0| 6f 75 74 20 74 68 65 20 | 62 6f 64 79 2e 0a 54 68 |out the |body..Th|
|000003d0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 73 68 6f 72 |e follow|ing shor|
|000003e0| 74 68 61 6e 64 20 6e 6f | 74 61 74 69 6f 6e 73 20 |thand no|tations |
|000003f0| 61 72 65 20 75 73 65 64 | 3a 0a 5c 70 61 72 0a 5c |are used|:.\par.\|
|00000400| 62 65 67 69 6e 7b 74 61 | 62 75 6c 61 72 2a 7d 7b |begin{ta|bular*}{|
|00000410| 5c 74 65 78 74 77 69 64 | 74 68 7d 7b 6c 40 7b 5c |\textwid|th}{l@{\|
|00000420| 65 78 74 72 61 63 6f 6c | 73 65 70 7b 5c 66 69 6c |extracol|sep{\fil|
|00000430| 6c 7d 7d 70 7b 5c 64 65 | 73 63 77 69 64 74 68 7d |l}}p{\de|scwidth}|
|00000440| 7d 0a 7b 5c 74 74 20 3c | 74 79 70 65 3e 7d 0a 26 |}.{\tt <|type>}.&|
|00000450| 0a 41 20 74 79 70 65 2e | 0a 5c 5c 0a 7b 5c 74 74 |.A type.|.\\.{\tt|
|00000460| 20 3c 63 6f 6e 73 3e 7d | 0a 26 0a 41 20 63 6f 6e | <cons>}|.&.A con|
|00000470| 73 74 72 75 63 74 6f 72 | 2e 0a 5c 5c 0a 7b 5c 74 |structor|..\\.{\t|
|00000480| 74 20 3c 65 6c 6d 74 79 | 70 65 3e 7d 0a 26 0a 41 |t <elmty|pe>}.&.A|
|00000490| 20 74 79 70 65 20 6f 66 | 20 61 6e 20 65 6c 65 6d | type of| an elem|
|000004a0| 65 6e 74 20 69 6e 20 61 | 20 63 6f 6e 73 74 72 75 |ent in a| constru|
|000004b0| 63 74 6f 72 2e 0a 5c 5c | 0a 7b 5c 74 74 20 3c 65 |ctor..\\|.{\tt <e|
|000004c0| 6c 6d 6e 61 6d 65 3e 7d | 0a 26 0a 41 20 6e 61 6d |lmname>}|.&.A nam|
|000004d0| 65 20 6f 66 20 61 6e 20 | 65 6c 65 6d 65 6e 74 20 |e of an |element |
|000004e0| 69 6e 20 61 20 63 6f 6e | 73 74 72 75 63 74 6f 72 |in a con|structor|
|000004f0| 2e 0a 5c 5c 0a 7b 5c 74 | 74 20 3c 73 6f 6d 65 74 |..\\.{\t|t <somet|
|00000500| 68 69 6e 67 3e 7d 0a 26 | 0a 54 68 65 20 61 63 74 |hing>}.&|.The act|
|00000510| 75 61 6c 20 63 6f 6e 74 | 65 6e 74 73 20 6f 66 20 |ual cont|ents of |
|00000520| 74 68 69 73 20 66 72 61 | 67 6d 65 6e 74 20 69 73 |this fra|gment is|
|00000530| 20 6e 6f 74 20 69 6d 70 | 6f 72 74 61 6e 74 2e 0a | not imp|ortant..|
|00000540| 5c 5c 0a 7b 5c 74 74 20 | 3c 62 61 73 65 6e 61 6d |\\.{\tt |<basenam|
|00000550| 65 3e 7d 0a 26 0a 46 69 | 6c 6c 20 69 6e 20 74 68 |e>}.&.Fi|ll in th|
|00000560| 65 20 76 61 6c 75 65 20 | 6f 66 20 7b 5c 74 6d 7d |e value |of {\tm}|
|00000570| 20 76 61 72 69 61 62 6c | 65 20 7b 5c 74 74 20 62 | variabl|e {\tt b|
|00000580| 61 73 65 6e 61 6d 65 7d | 2e 0a 5c 65 6e 64 7b 74 |asename}|..\end{t|
|00000590| 61 62 75 6c 61 72 2a 7d | 0a 5c 73 65 63 74 69 6f |abular*}|.\sectio|
|000005a0| 6e 7b 41 20 71 75 69 63 | 6b 20 69 6e 74 72 6f 64 |n{A quic|k introd|
|000005b0| 75 63 74 69 6f 6e 20 74 | 6f 20 74 68 65 20 75 73 |uction t|o the us|
|000005c0| 65 20 6f 66 20 74 68 65 | 20 74 65 6d 70 6c 61 74 |e of the| templat|
|000005d0| 65 73 7d 0a 5c 6c 61 62 | 65 6c 7b 73 65 63 3a 71 |es}.\lab|el{sec:q|
|000005e0| 75 69 63 6b 69 6e 74 72 | 6f 7d 0a 42 65 66 6f 72 |uickintr|o}.Befor|
|000005f0| 65 20 79 6f 75 20 73 74 | 61 72 74 20 74 6f 20 75 |e you st|art to u|
|00000600| 73 65 20 7b 5c 74 6d 7d | 20 69 73 20 69 73 20 75 |se {\tm}| is is u|
|00000610| 73 65 66 75 6c 20 74 6f | 20 72 65 61 6c 69 7a 65 |seful to| realize|
|00000620| 20 77 68 61 74 20 74 68 | 65 20 73 74 72 6f 6e 67 | what th|e strong|
|00000630| 20 61 6e 64 0a 77 65 61 | 6b 20 70 6f 69 6e 74 73 | and.wea|k points|
|00000640| 20 6f 66 20 7b 5c 74 6d | 7d 20 61 72 65 3a 0a 5c | of {\tm|} are:.\|
|00000650| 62 65 67 69 6e 7b 69 74 | 65 6d 69 7a 65 7d 0a 5c |begin{it|emize}.\|
|00000660| 69 74 65 6d 5b 24 2b 24 | 5d 0a 57 69 74 68 20 7b |item[$+$|].With {|
|00000670| 5c 74 6d 7d 20 69 74 20 | 69 73 20 73 69 6d 70 6c |\tm} it |is simpl|
|00000680| 65 20 74 6f 20 65 78 63 | 68 61 6e 67 65 20 73 74 |e to exc|hange st|
|00000690| 72 75 63 74 75 72 65 64 | 20 64 61 74 61 20 62 65 |ructured| data be|
|000006a0| 74 77 65 65 6e 20 70 72 | 6f 67 72 61 6d 73 0a 77 |tween pr|ograms.w|
|000006b0| 72 69 74 74 65 6e 20 69 | 6e 20 64 69 66 66 65 72 |ritten i|n differ|
|000006c0| 65 6e 74 20 70 72 6f 67 | 72 61 6d 6d 69 6e 67 20 |ent prog|ramming |
|000006d0| 6c 61 6e 67 75 61 67 65 | 73 2e 0a 5c 69 74 65 6d |language|s..\item|
|000006e0| 5b 24 2b 24 5d 0a 43 6f | 64 65 20 67 65 6e 65 72 |[$+$].Co|de gener|
|000006f0| 61 74 65 64 20 62 79 20 | 7b 5c 74 6d 7d 20 69 73 |ated by |{\tm} is|
|00000700| 20 63 6f 6e 73 69 73 74 | 65 6e 74 3a 20 61 6e 79 | consist|ent: any|
|00000710| 20 63 68 61 6e 67 65 20 | 69 6e 20 74 68 65 20 73 | change |in the s|
|00000720| 74 72 75 63 74 75 72 65 | 0a 77 69 6c 6c 20 62 65 |tructure|.will be|
|00000730| 20 72 65 66 6c 65 63 74 | 65 64 20 69 6e 20 61 6c | reflect|ed in al|
|00000740| 6c 20 7b 5c 70 61 73 63 | 61 6c 7d 20 72 65 63 6f |l {\pasc|al} reco|
|00000750| 72 64 20 64 65 66 69 6e | 69 74 69 6f 6e 73 20 61 |rd defin|itions a|
|00000760| 6e 64 20 61 6c 6c 20 63 | 6f 64 65 0a 74 68 61 74 |nd all c|ode.that|
|00000770| 20 69 73 20 67 65 6e 65 | 72 61 74 65 64 20 62 79 | is gene|rated by|
|00000780| 20 7b 5c 74 6d 7d 2e 0a | 41 6c 73 6f 2c 0a 74 68 | {\tm}..|Also,.th|
|00000790| 65 20 67 65 6e 65 72 61 | 74 65 64 20 66 75 6e 63 |e genera|ted func|
|000007a0| 74 69 6f 6e 73 20 77 69 | 6c 6c 20 62 65 20 63 6f |tions wi|ll be co|
|000007b0| 6e 73 69 73 74 65 6e 74 | 6c 79 20 63 6f 72 72 65 |nsistent|ly corre|
|000007c0| 63 74 20 28 6f 72 20 69 | 6e 63 6f 72 72 65 63 74 |ct (or i|ncorrect|
|000007d0| 29 20 66 6f 72 20 61 6c | 6c 0a 74 79 70 65 73 20 |) for al|l.types |
|000007e0| 69 6e 20 61 6c 6c 20 67 | 65 6e 65 72 61 74 65 64 |in all g|enerated|
|000007f0| 20 66 69 6c 65 73 2e 0a | 5c 69 74 65 6d 5b 24 2d | files..|\item[$-|
|00000800| 24 5d 0a 54 68 65 20 75 | 73 65 64 20 72 65 70 72 |$].The u|sed repr|
|00000810| 65 73 65 6e 74 61 74 69 | 6f 6e 20 6d 61 79 20 6e |esentati|on may n|
|00000820| 6f 74 20 62 65 20 6f 70 | 74 69 6d 61 6c 20 66 6f |ot be op|timal fo|
|00000830| 72 20 79 6f 75 72 20 70 | 72 6f 62 6c 65 6d 2e 0a |r your p|roblem..|
|00000840| 5c 65 6e 64 7b 69 74 65 | 6d 69 7a 65 7d 0a 5c 70 |\end{ite|mize}.\p|
|00000850| 61 72 0a 49 66 20 79 6f | 75 20 61 72 65 20 63 6f |ar.If yo|u are co|
|00000860| 6e 76 69 6e 63 65 64 20 | 74 68 61 74 20 74 68 65 |nvinced |that the|
|00000870| 20 61 64 76 61 6e 74 61 | 67 65 73 20 6f 75 74 77 | advanta|ges outw|
|00000880| 65 69 67 68 74 20 74 68 | 65 20 64 69 73 61 64 76 |eight th|e disadv|
|00000890| 61 6e 74 61 67 65 73 0a | 74 68 65 6e 20 79 6f 75 |antages.|then you|
|000008a0| 20 63 61 6e 20 75 73 65 | 20 74 68 65 20 66 6f 6c | can use| the fol|
|000008b0| 6c 6f 77 69 6e 67 20 73 | 74 65 70 73 20 74 6f 20 |lowing s|teps to |
|000008c0| 6f 62 74 61 69 6e 20 63 | 6f 64 65 20 66 72 6f 6d |obtain c|ode from|
|000008d0| 20 7b 5c 74 6d 7d 2e 0a | 54 68 65 20 73 74 65 70 | {\tm}..|The step|
|000008e0| 73 20 61 72 65 20 69 6c | 6c 75 73 74 72 61 74 65 |s are il|lustrate|
|000008f0| 64 20 62 79 20 61 6e 20 | 65 78 61 6d 70 6c 65 2e |d by an |example.|
|00000900| 0a 5c 62 65 67 69 6e 7b | 65 6e 75 6d 65 72 61 74 |.\begin{|enumerat|
|00000910| 65 7d 0a 5c 69 74 65 6d | 0a 44 65 73 69 67 6e 20 |e}.\item|.Design |
|00000920| 74 68 65 20 73 74 72 75 | 63 74 75 72 65 73 20 66 |the stru|ctures f|
|00000930| 6f 72 20 79 6f 75 72 20 | 70 72 6f 62 6c 65 6d 2c |or your |problem,|
|00000940| 0a 61 6e 64 20 65 6e 63 | 6f 64 65 20 69 74 20 69 |.and enc|ode it i|
|00000950| 6e 20 61 20 73 74 72 75 | 63 74 75 72 65 20 64 65 |n a stru|cture de|
|00000960| 73 63 72 69 70 74 69 6f | 6e 20 66 69 6c 65 2e 0a |scriptio|n file..|
|00000970| 46 6f 72 20 74 68 65 20 | 65 78 61 6d 70 6c 65 20 |For the |example |
|00000980| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 73 74 |the foll|owing st|
|00000990| 72 75 63 74 75 72 65 73 | 20 61 72 65 20 75 73 65 |ructures| are use|
|000009a0| 64 3a 0a 5c 62 65 67 69 | 6e 7b 6c 69 73 74 69 6e |d:.\begi|n{listin|
|000009b0| 67 7d 0a 5c 76 65 72 62 | 66 69 6c 65 7b 70 6c 6f |g}.\verb|file{plo|
|000009c0| 74 2e 64 73 7d 0a 5c 65 | 6e 64 7b 6c 69 73 74 69 |t.ds}.\e|nd{listi|
|000009d0| 6e 67 7d 0a 5c 69 74 65 | 6d 0a 43 72 65 61 74 65 |ng}.\ite|m.Create|
|000009e0| 20 61 20 63 6f 6e 66 69 | 67 75 72 61 74 69 6f 6e | a confi|guration|
|000009f0| 20 66 69 6c 65 20 74 68 | 61 74 20 73 65 74 73 20 | file th|at sets |
|00000a00| 74 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 7b 5c |the foll|owing {\|
|00000a10| 74 6d 7d 20 76 61 72 69 | 61 62 6c 65 73 3a 0a 5c |tm} vari|ables:.\|
|00000a20| 62 65 67 69 6e 7b 69 74 | 65 6d 69 7a 65 7d 0a 5c |begin{it|emize}.\|
|00000a30| 69 74 65 6d 0a 54 68 65 | 20 76 61 72 69 61 62 6c |item.The| variabl|
|00000a40| 65 20 7b 5c 74 74 20 62 | 61 73 65 6e 61 6d 65 7d |e {\tt b|asename}|
|00000a50| 3a 0a 61 20 67 65 6e 65 | 72 61 6c 20 6e 61 6d 65 |:.a gene|ral name|
|00000a60| 20 66 6f 72 20 74 68 65 | 20 67 65 6e 65 72 61 74 | for the| generat|
|00000a70| 65 64 20 63 6f 64 65 2e | 0a 5c 69 74 65 6d 0a 54 |ed code.|.\item.T|
|00000a80| 68 65 20 76 61 72 69 61 | 62 6c 65 20 7b 5c 74 74 |he varia|ble {\tt|
|00000a90| 20 77 61 6e 74 64 65 66 | 73 7d 3a 20 74 68 65 20 | wantdef|s}: the |
|00000aa0| 6e 61 6d 65 73 20 6f 66 | 20 74 68 65 20 64 65 66 |names of| the def|
|00000ab0| 69 6e 69 74 69 6f 6e 73 | 20 74 68 61 74 20 79 6f |initions| that yo|
|00000ac0| 75 0a 77 69 6c 6c 20 75 | 73 65 20 69 6e 20 79 6f |u.will u|se in yo|
|00000ad0| 75 72 20 70 72 6f 67 72 | 61 6d 2e 0a 49 66 20 74 |ur progr|am..If t|
|00000ae0| 68 65 73 65 20 64 65 66 | 69 6e 69 74 69 6f 6e 73 |hese def|initions|
|00000af0| 20 72 65 71 75 69 72 65 | 20 6f 74 68 65 72 20 64 | require| other d|
|00000b00| 65 66 69 6e 69 74 69 6f | 6e 73 20 66 6f 72 20 74 |efinitio|ns for t|
|00000b10| 79 70 65 73 20 64 65 66 | 69 6e 65 64 20 69 6e 0a |ypes def|ined in.|
|00000b20| 74 68 65 20 64 61 74 61 | 73 74 72 75 63 74 75 72 |the data|structur|
|00000b30| 65 20 64 65 66 69 6e 69 | 74 69 6f 6e 20 66 69 6c |e defini|tion fil|
|00000b40| 65 2c 0a 74 68 69 73 20 | 77 69 6c 6c 20 62 65 20 |e,.this |will be |
|00000b50| 64 65 64 75 63 65 64 2c | 20 61 6e 64 20 74 68 65 |deduced,| and the|
|00000b60| 79 20 77 69 6c 6c 20 62 | 65 20 67 65 6e 65 72 61 |y will b|e genera|
|00000b70| 74 65 64 2e 0a 46 6f 72 | 20 6c 69 62 72 61 72 79 |ted..For| library|
|00000b80| 20 61 6e 64 20 73 75 70 | 70 6f 72 74 20 66 75 6e | and sup|port fun|
|00000b90| 63 74 69 6f 6e 73 20 74 | 68 69 73 20 77 69 6c 6c |ctions t|his will|
|00000ba0| 20 7b 5c 65 6d 20 6e 6f | 74 7d 20 62 65 20 64 65 | {\em no|t} be de|
|00000bb0| 64 75 63 65 64 2c 0a 61 | 6e 64 20 79 6f 75 20 6d |duced,.a|nd you m|
|00000bc0| 75 73 74 20 61 64 64 20 | 74 68 65 20 6e 61 6d 65 |ust add |the name|
|00000bd0| 73 20 6f 66 20 74 68 65 | 73 65 20 66 75 6e 63 74 |s of the|se funct|
|00000be0| 69 6f 6e 73 20 74 6f 20 | 7b 5c 74 74 20 77 61 6e |ions to |{\tt wan|
|00000bf0| 74 64 65 66 73 7d 2e 0a | 5c 69 74 65 6d 0a 54 68 |tdefs}..|\item.Th|
|00000c00| 65 20 76 61 72 69 61 62 | 6c 65 20 7b 5c 74 74 20 |e variab|le {\tt |
|00000c10| 6e 6f 74 77 61 6e 74 64 | 65 66 73 7d 3a 0a 69 6e |notwantd|efs}:.in|
|00000c20| 20 74 68 65 20 72 61 72 | 65 20 63 61 73 65 20 74 | the rar|e case t|
|00000c30| 68 61 74 20 7b 5c 74 6d | 7d 20 64 65 64 75 63 65 |hat {\tm|} deduce|
|00000c40| 73 20 74 68 61 74 20 61 | 20 64 65 66 69 6e 69 74 |s that a| definit|
|00000c50| 69 6f 6e 20 6d 75 73 74 | 20 62 65 20 67 65 6e 65 |ion must| be gene|
|00000c60| 72 61 74 65 64 0a 77 68 | 69 6c 65 20 74 68 69 73 |rated.wh|ile this|
|00000c70| 20 69 73 20 6e 6f 74 20 | 64 65 73 69 72 61 62 6c | is not |desirabl|
|00000c80| 65 2c 0a 74 68 69 73 20 | 64 65 66 69 6e 69 74 69 |e,.this |definiti|
|00000c90| 6f 6e 20 63 61 6e 20 62 | 65 20 61 70 70 65 6e 64 |on can b|e append|
|00000ca0| 65 64 20 74 6f 20 74 68 | 65 20 6c 69 73 74 20 6f |ed to th|e list o|
|00000cb0| 66 20 76 61 72 69 61 62 | 6c 65 20 7b 5c 74 74 20 |f variab|le {\tt |
|00000cc0| 6e 6f 74 77 61 6e 74 64 | 65 66 73 7d 2e 0a 5c 65 |notwantd|efs}..\e|
|00000cd0| 6e 64 7b 69 74 65 6d 69 | 7a 65 7d 0a 46 6f 72 20 |nd{itemi|ze}.For |
|00000ce0| 74 68 65 20 72 75 6e 6e | 69 6e 67 20 65 78 61 6d |the runn|ing exam|
|00000cf0| 70 6c 65 20 61 20 66 69 | 6c 65 20 7b 5c 74 74 20 |ple a fi|le {\tt |
|00000d00| 64 65 6d 6f 63 6f 6e 66 | 2e 74 7d 20 69 73 20 75 |democonf|.t} is u|
|00000d10| 73 65 64 20 77 69 74 68 | 20 74 68 65 0a 66 6f 6c |sed with| the.fol|
|00000d20| 6c 6f 77 69 6e 67 20 63 | 6f 6e 74 65 6e 74 73 3a |lowing c|ontents:|
|00000d30| 0a 5c 62 65 67 69 6e 7b | 6c 69 73 74 69 6e 67 7d |.\begin{|listing}|
|00000d40| 0a 5c 76 65 72 62 66 69 | 6c 65 7b 64 65 6d 6f 63 |.\verbfi|le{democ|
|00000d50| 6f 6e 66 2e 74 7d 0a 5c | 65 6e 64 7b 6c 69 73 74 |onf.t}.\|end{list|
|00000d60| 69 6e 67 7d 0a 5c 69 74 | 65 6d 0a 43 72 65 61 74 |ing}.\it|em.Creat|
|00000d70| 65 20 61 20 7b 5c 74 6d | 7d 20 73 6b 65 6c 65 74 |e a {\tm|} skelet|
|00000d80| 6f 6e 20 66 69 6c 65 20 | 63 6f 6e 74 61 69 6e 69 |on file |containi|
|00000d90| 6e 67 20 74 68 65 20 72 | 65 71 75 69 72 65 64 20 |ng the r|equired |
|00000da0| 7b 5c 70 61 73 63 61 6c | 7d 20 65 6e 76 69 72 6f |{\pascal|} enviro|
|00000db0| 6e 6d 65 6e 74 2e 0a 54 | 68 69 73 20 66 69 6c 65 |nment..T|his file|
|00000dc0| 20 73 68 6f 75 6c 64 20 | 61 74 20 6c 65 61 73 74 | should |at least|
|00000dd0| 20 63 6f 6e 74 61 69 6e | 0a 5c 62 65 67 69 6e 7b | contain|.\begin{|
|00000de0| 69 74 65 6d 69 7a 65 7d | 0a 5c 69 74 65 6d 0a 41 |itemize}|.\item.A|
|00000df0| 6e 20 7b 5c 74 74 20 2e | 69 6e 73 65 72 74 7d 20 |n {\tt .|insert} |
|00000e00| 6f 66 20 74 68 65 20 63 | 6f 6e 66 69 67 75 72 61 |of the c|onfigura|
|00000e10| 74 69 6f 6e 20 66 69 6c | 65 2c 20 69 6e 20 74 68 |tion fil|e, in th|
|00000e20| 69 73 20 65 78 61 6d 70 | 6c 65 0a 7b 5c 74 74 20 |is examp|le.{\tt |
|00000e30| 64 65 6d 6f 63 6f 6e 66 | 2e 74 7d 2e 0a 5c 69 74 |democonf|.t}..\it|
|00000e40| 65 6d 0a 41 6e 20 7b 5c | 74 74 20 2e 69 6e 63 6c |em.An {\|tt .incl|
|00000e50| 75 64 65 7d 20 6f 66 20 | 74 68 65 20 6e 65 63 65 |ude} of |the nece|
|00000e60| 73 73 61 72 79 20 74 65 | 6d 70 6c 61 74 65 20 66 |ssary te|mplate f|
|00000e70| 69 6c 65 73 20 28 73 65 | 65 0a 73 65 63 74 69 6f |iles (se|e.sectio|
|00000e80| 6e 20 5c 72 65 66 7b 73 | 65 63 3a 74 65 6d 70 6c |n \ref{s|ec:templ|
|00000e90| 61 74 65 73 7d 29 2e 0a | 5c 69 74 65 6d 0a 41 6e |ates})..|\item.An|
|00000ea0| 20 69 6e 76 6f 63 61 74 | 69 6f 6e 2c 20 65 61 72 | invocat|ion, ear|
|00000eb0| 6c 79 20 69 6e 20 74 68 | 65 20 70 72 6f 67 72 61 |ly in th|e progra|
|00000ec0| 6d 2c 20 6f 66 20 7b 5c | 74 74 20 49 6e 69 74 3c |m, of {\|tt Init<|
|00000ed0| 62 61 73 65 6e 61 6d 65 | 3e 7d 2e 0a 5c 65 6e 64 |basename|>}..\end|
|00000ee0| 7b 69 74 65 6d 69 7a 65 | 7d 0a 54 68 65 20 66 69 |{itemize|}.The fi|
|00000ef0| 6c 65 20 77 69 6c 6c 20 | 61 6c 73 6f 20 63 6f 6e |le will |also con|
|00000f00| 74 61 69 6e 20 6f 74 68 | 65 72 20 73 74 75 66 66 |tain oth|er stuff|
|00000f10| 2c 0a 6c 69 6b 65 20 64 | 65 66 69 6e 69 74 69 6f |,.like d|efinitio|
|00000f20| 6e 73 20 66 6f 72 20 70 | 72 69 6d 69 74 69 76 65 |ns for p|rimitive|
|00000f30| 20 74 79 70 65 73 2e 0a | 49 66 20 79 6f 75 72 20 | types..|If your |
|00000f40| 7b 5c 70 61 73 63 61 6c | 7d 20 64 6f 65 73 20 6e |{\pascal|} does n|
|00000f50| 6f 74 20 73 75 70 70 6f | 72 74 20 73 65 70 61 72 |ot suppo|rt separ|
|00000f60| 61 74 65 20 63 6f 6d 70 | 69 6c 61 74 69 6f 6e 2c |ate comp|ilation,|
|00000f70| 0a 74 68 65 20 66 69 6c | 65 20 6d 75 73 74 20 61 |.the fil|e must a|
|00000f80| 6c 73 6f 20 63 6f 6e 74 | 61 69 6e 20 61 6c 6c 20 |lso cont|ain all |
|00000f90| 6f 74 68 65 72 20 63 6f | 64 65 2e 0a 59 6f 75 20 |other co|de..You |
|00000fa0| 6d 61 79 20 77 61 6e 74 | 20 74 6f 20 75 73 65 20 |may want| to use |
|00000fb0| 74 68 65 20 7b 5c 74 6d | 7d 20 63 6f 6d 6d 61 6e |the {\tm|} comman|
|00000fc0| 64 20 7b 5c 74 74 20 63 | 6f 70 79 7d 20 66 6f 72 |d {\tt c|opy} for|
|00000fd0| 20 74 68 69 73 20 63 6f | 64 65 2c 0a 73 6f 20 74 | this co|de,.so t|
|00000fe0| 68 61 74 20 0a 79 6f 75 | 20 64 6f 20 6e 6f 74 20 |hat .you| do not |
|00000ff0| 68 61 76 65 20 74 6f 20 | 63 68 65 63 6b 20 61 6c |have to |check al|
|00001000| 6c 20 79 6f 75 72 20 7b | 5c 70 61 73 63 61 6c 7d |l your {|\pascal}|
|00001010| 20 63 6f 64 65 20 66 6f | 72 20 63 68 61 72 61 63 | code fo|r charac|
|00001020| 74 65 72 73 20 74 68 61 | 74 0a 7b 5c 74 6d 7d 20 |ters tha|t.{\tm} |
|00001030| 69 73 20 73 65 6e 73 69 | 74 69 76 65 20 66 6f 72 |is sensi|tive for|
|00001040| 2e 0a 5c 70 61 72 0a 46 | 6f 72 20 74 68 65 20 65 |..\par.F|or the e|
|00001050| 78 61 6d 70 6c 65 20 74 | 68 65 20 66 69 6c 65 20 |xample t|he file |
|00001060| 69 73 3a 0a 5c 62 65 67 | 69 6e 7b 6c 69 73 74 69 |is:.\beg|in{listi|
|00001070| 6e 67 7d 0a 5c 76 65 72 | 62 66 69 6c 65 7b 64 65 |ng}.\ver|bfile{de|
|00001080| 6d 6f 2e 70 74 7d 0a 5c | 65 6e 64 7b 6c 69 73 74 |mo.pt}.\|end{list|
|00001090| 69 6e 67 7d 0a 5c 69 74 | 65 6d 0a 41 64 64 20 61 |ing}.\it|em.Add a|
|000010a0| 20 6d 61 6b 65 20 72 75 | 6c 65 20 74 6f 20 79 6f | make ru|le to yo|
|000010b0| 75 72 20 6d 61 6b 65 66 | 69 6c 65 20 74 6f 20 67 |ur makef|ile to g|
|000010c0| 65 6e 65 72 61 74 65 20 | 74 68 65 20 63 6f 64 65 |enerate |the code|
|000010d0| 3a 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |:.\begin|{verbati|
|000010e0| 6d 7d 0a 64 65 6d 6f 2e | 70 20 3a 20 70 6c 6f 74 |m}.demo.|p : plot|
|000010f0| 2e 64 73 20 64 65 6d 6f | 2e 70 74 20 64 65 6d 6f |.ds demo|.pt demo|
|00001100| 63 6f 6e 66 2e 74 0a 20 | 20 20 20 20 20 20 20 74 |conf.t. | t|
|00001110| 6d 20 70 6c 6f 74 2e 64 | 73 20 64 65 6d 6f 2e 70 |m plot.d|s demo.p|
|00001120| 74 20 3e 20 64 65 6d 6f | 2e 70 0a 5c 65 6e 64 7b |t > demo|.p.\end{|
|00001130| 76 65 72 62 61 74 69 6d | 7d 0a 5c 65 6e 64 7b 65 |verbatim|}.\end{e|
|00001140| 6e 75 6d 65 72 61 74 65 | 7d 0a 5c 70 61 72 0a 54 |numerate|}.\par.T|
|00001150| 68 65 20 66 69 6c 65 20 | 7b 5c 74 74 20 64 65 6d |he file |{\tt dem|
|00001160| 6f 2e 70 7d 20 74 68 61 | 74 20 69 73 20 67 65 6e |o.p} tha|t is gen|
|00001170| 65 72 61 74 65 64 20 66 | 72 6f 6d 20 6f 75 72 0a |erated f|rom our.|
|00001180| 65 78 61 6d 70 6c 65 20 | 63 6f 6e 66 69 67 75 72 |example |configur|
|00001190| 61 74 69 6f 6e 20 69 73 | 20 6c 69 73 74 65 64 20 |ation is| listed |
|000011a0| 69 6e 20 61 70 70 65 6e | 64 69 78 20 5c 72 65 66 |in appen|dix \ref|
|000011b0| 7b 73 65 63 3a 64 65 6d | 6f 7d 2e 0a 5c 73 65 63 |{sec:dem|o}..\sec|
|000011c0| 74 69 6f 6e 7b 54 68 65 | 20 7b 5c 70 61 73 63 61 |tion{The| {\pasca|
|000011d0| 6c 7d 20 74 65 6d 70 6c | 61 74 65 73 7d 0a 5c 6c |l} templ|ates}.\l|
|000011e0| 61 62 65 6c 7b 73 65 63 | 3a 74 65 6d 70 6c 61 74 |abel{sec|:templat|
|000011f0| 65 73 7d 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |es}.\sub|section{|
|00001200| 67 65 6e 65 72 61 6c 7d | 0a 49 6e 20 74 68 65 20 |general}|.In the |
|00001210| 64 65 73 69 67 6e 20 6f | 66 20 74 68 65 20 7b 5c |design o|f the {\|
|00001220| 70 61 73 63 61 6c 7d 20 | 74 65 6d 70 6c 61 74 65 |pascal} |template|
|00001230| 73 20 69 74 20 68 61 73 | 20 62 65 65 6e 20 74 72 |s it has| been tr|
|00001240| 69 65 64 20 74 6f 20 6d | 61 6b 65 0a 74 68 65 6d |ied to m|ake.them|
|00001250| 20 61 73 20 67 65 6e 65 | 72 61 6c 20 61 73 20 70 | as gene|ral as p|
|00001260| 6f 73 73 69 62 6c 65 2e | 0a 48 6f 77 65 76 65 72 |ossible.|.However|
|00001270| 2c 20 74 68 65 20 6f 72 | 69 67 69 6e 61 6c 20 7b |, the or|iginal {|
|00001280| 5c 70 61 73 63 61 6c 7d | 20 64 65 66 69 6e 69 74 |\pascal}| definit|
|00001290| 69 6f 6e 20 69 73 20 74 | 6f 6f 20 72 65 73 74 72 |ion is t|oo restr|
|000012a0| 69 63 74 65 64 20 66 6f | 72 0a 65 61 73 79 20 63 |icted fo|r.easy c|
|000012b0| 6f 64 65 20 67 65 6e 65 | 72 61 74 69 6f 6e 2c 0a |ode gene|ration,.|
|000012c0| 73 6f 20 74 68 61 74 20 | 61 20 6e 75 6d 62 65 72 |so that |a number|
|000012d0| 20 6f 66 20 61 73 73 75 | 6d 70 74 69 6f 6e 73 20 | of assu|mptions |
|000012e0| 68 61 64 20 74 6f 20 62 | 65 20 6d 61 64 65 2e 0a |had to b|e made..|
|000012f0| 54 68 65 79 20 61 72 65 | 3a 0a 5c 62 65 67 69 6e |They are|:.\begin|
|00001300| 7b 65 6e 75 6d 65 72 61 | 74 65 7d 0a 5c 69 74 65 |{enumera|te}.\ite|
|00001310| 6d 0a 54 68 65 20 7b 5c | 70 61 73 63 61 6c 7d 20 |m.The {\|pascal} |
|00001320| 63 6f 6d 70 69 6c 65 72 | 20 64 69 73 74 69 6e 67 |compiler| disting|
|00001330| 75 69 73 68 65 73 20 75 | 70 70 65 72 63 61 73 65 |uishes u|ppercase|
|00001340| 20 61 6e 64 20 6c 6f 77 | 65 72 63 61 73 65 20 63 | and low|ercase c|
|00001350| 68 61 72 61 63 74 65 72 | 73 0a 69 6e 20 73 79 6d |haracter|s.in sym|
|00001360| 62 6f 6c 73 2e 0a 54 68 | 61 74 20 69 73 2c 0a 7b |bols..Th|at is,.{|
|00001370| 5c 74 74 20 5a 57 4f 49 | 4e 47 7d 20 69 73 20 64 |\tt ZWOI|NG} is d|
|00001380| 69 66 66 65 72 65 6e 74 | 20 66 72 6f 6d 20 7b 5c |ifferent| from {\|
|00001390| 74 74 20 7a 77 6f 69 6e | 67 7d 2c 0a 61 6e 64 20 |tt zwoin|g},.and |
|000013a0| 62 6f 74 68 20 61 72 65 | 20 64 69 66 66 65 72 65 |both are| differe|
|000013b0| 6e 74 20 66 72 6f 6d 20 | 7b 5c 74 74 20 5a 77 6f |nt from |{\tt Zwo|
|000013c0| 49 6e 47 7d 2e 0a 5c 69 | 74 65 6d 0a 54 68 65 72 |InG}..\i|tem.Ther|
|000013d0| 65 20 69 73 20 6e 6f 20 | 28 6f 72 20 61 20 6c 61 |e is no |(or a la|
|000013e0| 72 67 65 29 20 75 70 70 | 65 72 20 62 6f 75 6e 64 |rge) upp|er bound|
|000013f0| 20 74 6f 20 74 68 65 20 | 6e 75 6d 62 65 72 20 6f | to the |number o|
|00001400| 66 20 73 69 67 6e 69 66 | 69 63 61 6e 74 20 63 68 |f signif|icant ch|
|00001410| 61 72 61 63 74 65 72 73 | 0a 69 6e 20 73 79 6d 62 |aracters|.in symb|
|00001420| 6f 6c 20 6e 61 6d 65 73 | 2e 0a 41 74 20 6c 65 61 |ol names|..At lea|
|00001430| 73 74 20 74 68 65 20 63 | 68 61 72 61 63 74 65 72 |st the c|haracter|
|00001440| 73 20 6f 66 20 74 68 65 | 20 74 79 70 65 2c 20 63 |s of the| type, c|
|00001450| 6f 6e 73 74 72 75 63 74 | 6f 72 20 61 6e 64 20 65 |onstruct|or and e|
|00001460| 6c 65 6d 65 6e 74 20 6e | 61 6d 65 73 0a 61 6e 64 |lement n|ames.and|
|00001470| 20 36 20 61 64 64 69 74 | 69 6f 6e 61 6c 20 63 68 | 6 addit|ional ch|
|00001480| 61 72 61 63 74 65 72 73 | 20 6d 75 73 74 20 62 65 |aracters| must be|
|00001490| 20 73 69 67 6e 69 66 69 | 63 61 6e 74 2e 0a 5c 69 | signifi|cant..\i|
|000014a0| 74 65 6d 0a 54 68 65 20 | 66 6f 6c 6c 6f 77 69 6e |tem.The |followin|
|000014b0| 67 20 73 74 61 6e 64 61 | 72 64 20 66 75 6e 63 74 |g standa|rd funct|
|000014c0| 69 6f 6e 73 20 61 6e 64 | 20 70 72 6f 63 65 64 75 |ions and| procedu|
|000014d0| 72 65 73 20 61 72 65 20 | 61 76 61 69 6c 61 62 6c |res are |availabl|
|000014e0| 65 2e 0a 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |e..\begi|n{verbat|
|000014f0| 69 6d 7d 0a 77 72 69 74 | 65 28 20 66 2c 20 65 2c |im}.writ|e( f, e,|
|00001500| 20 2e 2e 20 65 20 29 0a | 72 65 61 64 28 20 66 2c | .. e ).|read( f,|
|00001510| 20 65 20 29 0a 65 6f 66 | 28 20 66 20 29 0a 65 6f | e ).eof|( f ).eo|
|00001520| 6c 6e 28 20 66 20 29 0a | 6e 65 77 28 20 70 2c 20 |ln( f ).|new( p, |
|00001530| 74 61 67 20 29 0a 64 69 | 73 70 6f 73 65 28 20 70 |tag ).di|spose( p|
|00001540| 2c 20 74 61 67 20 29 0a | 5c 65 6e 64 7b 76 65 72 |, tag ).|\end{ver|
|00001550| 62 61 74 69 6d 7d 0a 5c | 69 74 65 6d 0a 54 68 65 |batim}.\|item.The|
|00001560| 20 74 79 70 65 20 6f 66 | 20 74 68 65 20 66 69 6c | type of| the fil|
|00001570| 65 20 68 61 6e 64 6c 65 | 73 20 66 6f 72 20 7b 5c |e handle|s for {\|
|00001580| 74 74 20 72 65 61 64 7d | 20 61 6e 64 20 7b 5c 74 |tt read}| and {\t|
|00001590| 74 20 77 72 69 74 65 7d | 20 69 73 20 7b 5c 74 74 |t write}| is {\tt|
|000015a0| 20 74 65 78 74 7d 2e 0a | 5c 65 6e 64 7b 65 6e 75 | text}..|\end{enu|
|000015b0| 6d 65 72 61 74 65 7d 0a | 5c 70 61 72 0a 49 6e 20 |merate}.|\par.In |
|000015c0| 61 6c 6c 20 72 65 63 6f | 72 64 20 74 79 70 65 73 |all reco|rd types|
|000015d0| 20 67 65 6e 65 72 61 74 | 65 64 20 62 79 20 74 68 | generat|ed by th|
|000015e0| 65 73 65 20 74 65 6d 70 | 6c 61 74 65 73 20 61 20 |ese temp|lates a |
|000015f0| 7b 5c 74 74 20 6e 65 78 | 74 7d 20 66 69 65 6c 64 |{\tt nex|t} field|
|00001600| 20 69 73 0a 69 6e 63 6c | 75 64 65 64 20 74 68 61 | is.incl|uded tha|
|00001610| 74 20 69 73 20 75 73 65 | 64 20 74 6f 20 63 72 65 |t is use|d to cre|
|00001620| 61 74 65 20 6c 69 6e 6b | 65 64 20 6c 69 73 74 73 |ate link|ed lists|
|00001630| 20 6f 66 20 74 68 65 20 | 72 65 63 6f 72 64 73 2e | of the |records.|
|00001640| 0a 54 68 65 72 65 66 6f | 72 65 2c 20 74 68 65 20 |.Therefo|re, the |
|00001650| 74 79 70 65 20 6f 66 20 | 61 20 73 69 6e 67 6c 65 |type of |a single|
|00001660| 20 65 6c 65 6d 65 6e 74 | 20 61 6e 64 20 61 20 6c | element| and a l|
|00001670| 69 73 74 20 6f 66 20 74 | 68 65 73 65 20 65 6c 65 |ist of t|hese ele|
|00001680| 6d 65 6e 74 73 20 69 73 | 20 74 68 65 0a 73 61 6d |ments is| the.sam|
|00001690| 65 2e 0a 46 6f 72 20 63 | 6c 61 72 69 74 79 0a 64 |e..For c|larity.d|
|000016a0| 69 66 66 65 72 65 6e 74 | 20 74 79 70 65 20 6e 61 |ifferent| type na|
|000016b0| 6d 65 73 20 61 72 65 20 | 69 6e 74 72 6f 64 75 63 |mes are |introduc|
|000016c0| 65 64 20 66 6f 72 20 73 | 69 6e 67 6c 65 20 65 6c |ed for s|ingle el|
|000016d0| 65 6d 65 6e 74 73 20 61 | 6e 64 20 6c 69 73 74 73 |ements a|nd lists|
|000016e0| 2e 0a 5c 70 61 72 0a 44 | 75 65 20 74 6f 20 74 68 |..\par.D|ue to th|
|000016f0| 65 20 73 74 72 69 63 74 | 20 73 79 6e 74 61 78 20 |e strict| syntax |
|00001700| 6f 66 20 7b 5c 70 61 73 | 63 61 6c 7d 2c 0a 74 68 |of {\pas|cal},.th|
|00001710| 65 20 74 65 6d 70 6c 61 | 74 65 20 6d 75 73 74 20 |e templa|te must |
|00001720| 62 65 20 73 70 6c 69 74 | 20 75 70 20 69 6e 20 61 |be split| up in a|
|00001730| 20 6e 75 6d 62 65 72 20 | 6f 66 20 70 61 72 74 73 | number |of parts|
|00001740| 2c 0a 6f 6e 65 20 66 6f | 72 20 74 68 65 20 7b 5c |,.one fo|r the {\|
|00001750| 74 74 20 76 61 72 7d 2c | 20 7b 5c 74 74 20 74 79 |tt var},| {\tt ty|
|00001760| 70 65 7d 20 61 6e 64 20 | 63 6f 64 65 20 73 65 63 |pe} and |code sec|
|00001770| 74 69 6f 6e 73 2e 0a 54 | 68 69 73 20 69 73 20 61 |tions..T|his is a|
|00001780| 6c 73 6f 20 74 72 75 65 | 20 66 6f 72 20 74 68 65 |lso true| for the|
|00001790| 20 63 6f 64 65 20 6c 69 | 62 72 61 72 79 2e 0a 54 | code li|brary..T|
|000017a0| 68 65 72 65 66 6f 72 65 | 2c 0a 74 68 65 20 66 6f |herefore|,.the fo|
|000017b0| 6c 6c 6f 77 69 6e 67 20 | 74 65 6d 70 6c 61 74 65 |llowing |template|
|000017c0| 20 66 69 6c 65 73 20 61 | 72 65 20 70 72 6f 76 69 | files a|re provi|
|000017d0| 64 65 64 3a 0a 5c 62 65 | 67 69 6e 7b 66 6c 75 73 |ded:.\be|gin{flus|
|000017e0| 68 6c 65 66 74 7d 0a 5c | 62 65 67 69 6e 7b 74 61 |hleft}.\|begin{ta|
|000017f0| 62 75 6c 61 72 7d 7b 7c | 6c 7c 6c 7c 6c 7c 7d 0a |bular}{||l|l|l|}.|
|00001800| 5c 68 6c 69 6e 65 0a 66 | 69 6c 65 20 6e 61 6d 65 |\hline.f|ile name|
|00001810| 20 26 20 73 65 63 74 69 | 6f 6e 20 26 20 70 75 72 | & secti|on & pur|
|00001820| 70 6f 73 65 20 5c 5c 0a | 5c 68 6c 69 6e 65 0a 70 |pose \\.|\hline.p|
|00001830| 61 73 63 6f 64 65 2e 70 | 74 20 26 20 28 63 6f 64 |ascode.p|t & (cod|
|00001840| 65 29 20 26 20 43 6f 64 | 65 20 74 65 6d 70 6c 61 |e) & Cod|e templa|
|00001850| 74 65 2e 20 5c 5c 0a 70 | 61 73 63 6f 64 65 2e 68 |te. \\.p|ascode.h|
|00001860| 74 20 26 20 28 63 6f 64 | 65 29 20 26 20 7b 5c 74 |t & (cod|e) & {\t|
|00001870| 74 20 65 78 74 65 72 6e | 61 6c 7d 20 64 65 63 6c |t extern|al} decl|
|00001880| 61 72 61 74 69 6f 6e 20 | 74 65 6d 70 6c 61 74 65 |aration |template|
|00001890| 2e 20 5c 5c 0a 70 61 73 | 6c 69 62 2e 70 74 20 26 |. \\.pas|lib.pt &|
|000018a0| 20 28 63 6f 64 65 29 20 | 26 20 4c 69 62 72 61 72 | (code) |& Librar|
|000018b0| 79 20 6f 66 20 66 75 6e | 63 74 69 6f 6e 73 2e 20 |y of fun|ctions. |
|000018c0| 5c 5c 0a 70 61 73 6c 69 | 62 2e 68 74 20 26 20 28 |\\.pasli|b.ht & (|
|000018d0| 63 6f 64 65 29 20 26 20 | 7b 5c 74 74 20 65 78 74 |code) & |{\tt ext|
|000018e0| 65 72 6e 61 6c 7d 20 64 | 65 63 6c 61 72 61 74 69 |ernal} d|eclarati|
|000018f0| 6f 6e 20 6f 66 20 6c 69 | 62 72 61 72 79 20 66 75 |on of li|brary fu|
|00001900| 6e 63 74 69 6f 6e 73 2e | 20 5c 5c 0a 70 61 73 74 |nctions.| \\.past|
|00001910| 79 70 65 2e 70 74 20 26 | 20 7b 5c 74 74 20 74 79 |ype.pt &| {\tt ty|
|00001920| 70 65 7d 20 26 20 54 79 | 70 65 20 64 65 63 6c 61 |pe} & Ty|pe decla|
|00001930| 72 61 74 69 6f 6e 20 74 | 65 6d 70 6c 61 74 65 2e |ration t|emplate.|
|00001940| 20 5c 5c 0a 70 61 73 76 | 61 72 2e 70 74 20 26 20 | \\.pasv|ar.pt & |
|00001950| 7b 5c 74 74 20 76 61 72 | 7d 20 26 20 56 61 72 69 |{\tt var|} & Vari|
|00001960| 61 62 6c 65 20 64 65 63 | 6c 61 72 61 74 69 6f 6e |able dec|laration|
|00001970| 20 74 65 6d 70 6c 61 74 | 65 2e 20 5c 5c 0a 70 61 | templat|e. \\.pa|
|00001980| 73 67 76 61 72 2e 70 74 | 20 26 20 7b 5c 74 74 20 |sgvar.pt| & {\tt |
|00001990| 76 61 72 7d 20 26 20 47 | 65 6e 65 72 61 6c 20 76 |var} & G|eneral v|
|000019a0| 61 72 69 61 62 6c 65 20 | 64 65 63 6c 61 72 61 74 |ariable |declarat|
|000019b0| 69 6f 6e 73 2e 20 5c 5c | 0a 5c 68 6c 69 6e 65 0a |ions. \\|.\hline.|
|000019c0| 5c 65 6e 64 7b 74 61 62 | 75 6c 61 72 7d 0a 5c 65 |\end{tab|ular}.\e|
|000019d0| 6e 64 7b 66 6c 75 73 68 | 6c 65 66 74 7d 0a 5c 70 |nd{flush|left}.\p|
|000019e0| 61 72 0a 54 68 65 20 66 | 69 6c 65 73 20 7b 5c 74 |ar.The f|iles {\t|
|000019f0| 74 20 70 61 73 63 6f 64 | 65 2e 68 74 7d 20 61 6e |t pascod|e.ht} an|
|00001a00| 64 20 7b 5c 74 74 20 70 | 61 73 6c 69 62 2e 68 74 |d {\tt p|aslib.ht|
|00001a10| 7d 20 61 72 65 20 75 73 | 65 64 20 66 6f 72 0a 73 |} are us|ed for.s|
|00001a20| 65 70 61 72 61 74 65 20 | 63 6f 6d 70 69 6c 61 74 |eparate |compilat|
|00001a30| 69 6f 6e 2c 0a 73 65 65 | 20 73 65 63 74 69 6f 6e |ion,.see| section|
|00001a40| 20 5c 72 65 66 7b 73 65 | 63 3a 73 65 70 63 6f 6d | \ref{se|c:sepcom|
|00001a50| 70 7d 2e 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |p}..\sub|section{|
|00001a60| 69 6e 69 74 69 61 6c 69 | 7a 61 74 69 6f 6e 7d 0a |initiali|zation}.|
|00001a70| 42 65 66 6f 72 65 20 61 | 6e 79 20 6f 74 68 65 72 |Before a|ny other|
|00001a80| 20 7b 5c 74 6d 7d 20 67 | 65 6e 65 72 61 74 65 64 | {\tm} g|enerated|
|00001a90| 20 63 6f 64 65 20 69 73 | 20 75 73 65 64 20 74 68 | code is| used th|
|00001aa0| 65 20 70 72 6f 63 65 64 | 75 72 65 0a 7b 5c 74 74 |e proced|ure.{\tt|
|00001ab0| 20 49 6e 69 74 3c 62 61 | 73 65 6e 61 6d 65 3e 7d | Init<ba|sename>}|
|00001ac0| 20 6d 75 73 74 20 62 65 | 20 69 6e 76 6f 6b 65 64 | must be| invoked|
|00001ad0| 2e 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |..\begin|{verbati|
|00001ae0| 6d 7d 0a 70 72 6f 63 65 | 64 75 72 65 20 49 6e 69 |m}.proce|dure Ini|
|00001af0| 74 3c 62 61 73 65 6e 61 | 6d 65 3e 3b 0a 5c 65 6e |t<basena|me>;.\en|
|00001b00| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0a 5c 62 65 67 |d{verbat|im}.\beg|
|00001b10| 69 6e 7b 64 65 73 63 7d | 0a 44 6f 20 6e 65 63 65 |in{desc}|.Do nece|
|00001b20| 73 73 61 72 79 20 69 6e | 69 74 69 61 6c 69 7a 61 |ssary in|itializa|
|00001b30| 74 69 6f 6e 73 20 66 6f | 72 20 67 65 6e 65 72 61 |tions fo|r genera|
|00001b40| 74 65 64 20 7b 5c 74 6d | 7d 20 63 6f 64 65 2e 0a |ted {\tm|} code..|
|00001b50| 5c 65 6e 64 7b 64 65 73 | 63 7d 0a 5c 73 75 62 73 |\end{des|c}.\subs|
|00001b60| 65 63 74 69 6f 6e 7b 72 | 65 63 6f 72 64 73 7d 0a |ection{r|ecords}.|
|00001b70| 54 68 65 20 64 61 74 61 | 20 69 73 20 72 65 70 72 |The data| is repr|
|00001b80| 65 73 65 6e 74 65 64 20 | 75 73 69 6e 67 20 74 68 |esented |using th|
|00001b90| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 7b 5c 74 74 |e follow|ing {\tt|
|00001ba0| 20 74 79 70 65 7d 20 64 | 65 66 69 6e 69 74 69 6f | type} d|efinitio|
|00001bb0| 6e 73 3a 0a 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |ns:.\beg|in{verba|
|00001bc0| 74 69 6d 7d 0a 3c 74 79 | 70 65 3e 20 3d 20 5e 52 |tim}.<ty|pe> = ^R|
|00001bd0| 65 63 3c 74 79 70 65 3e | 3b 0a 3c 74 79 70 65 3e |ec<type>|;.<type>|
|00001be0| 6c 69 73 74 20 3d 20 3c | 74 79 70 65 3e 3b 0a 5c |list = <|type>;.\|
|00001bf0| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 5c 62 |end{verb|atim}.\b|
|00001c00| 65 67 69 6e 7b 64 65 73 | 63 7d 0a 46 69 72 73 74 |egin{des|c}.First|
|00001c10| 2c 20 61 6c 6c 20 74 79 | 70 65 73 20 61 6e 64 20 |, all ty|pes and |
|00001c20| 74 79 70 65 20 6c 69 73 | 74 73 20 61 72 65 20 64 |type lis|ts are d|
|00001c30| 65 66 69 6e 65 64 20 61 | 73 20 70 6f 69 6e 74 65 |efined a|s pointe|
|00001c40| 72 73 20 74 6f 20 61 20 | 63 65 72 74 61 69 6e 0a |rs to a |certain.|
|00001c50| 72 65 63 6f 72 64 2e 0a | 54 68 69 73 20 69 6e 64 |record..|This ind|
|00001c60| 69 72 65 63 74 20 77 61 | 79 20 69 73 20 75 73 65 |irect wa|y is use|
|00001c70| 64 20 74 6f 20 70 72 65 | 76 65 6e 74 20 70 72 6f |d to pre|vent pro|
|00001c80| 62 6c 65 6d 73 20 77 69 | 74 68 20 6d 75 74 75 61 |blems wi|th mutua|
|00001c90| 6c 6c 79 20 72 65 63 75 | 72 73 69 76 65 0a 74 79 |lly recu|rsive.ty|
|00001ca0| 70 65 73 2c 20 73 69 6e | 63 65 20 7b 5c 70 61 73 |pes, sin|ce {\pas|
|00001cb0| 63 61 6c 7d 20 64 6f 65 | 73 20 6e 6f 74 20 6d 69 |cal} doe|s not mi|
|00001cc0| 6e 64 20 74 68 65 20 69 | 6e 74 72 6f 64 75 63 74 |nd the i|ntroduct|
|00001cd0| 69 6f 6e 20 6f 66 20 70 | 6f 69 6e 74 65 72 73 20 |ion of p|ointers |
|00001ce0| 74 6f 20 61 6e 0a 28 74 | 65 6d 70 6f 72 61 72 69 |to an.(t|emporari|
|00001cf0| 6c 79 29 20 75 6e 6b 6e | 6f 77 6e 20 72 65 63 6f |ly) unkn|own reco|
|00001d00| 72 64 2c 0a 62 75 74 20 | 69 74 20 7b 5c 65 6d 20 |rd,.but |it {\em |
|00001d10| 64 6f 65 73 7d 20 6d 69 | 6e 64 20 72 65 66 65 72 |does} mi|nd refer|
|00001d20| 65 6e 63 65 73 20 74 6f | 20 75 6e 6b 6e 6f 77 6e |ences to| unknown|
|00001d30| 20 74 79 70 65 73 2e 0a | 46 6f 72 20 63 6c 61 72 | types..|For clar|
|00001d40| 69 74 79 0a 64 69 66 66 | 65 72 65 6e 74 20 74 79 |ity.diff|erent ty|
|00001d50| 70 65 20 6e 61 6d 65 73 | 20 61 72 65 20 69 6e 74 |pe names| are int|
|00001d60| 72 6f 64 75 63 65 64 20 | 66 6f 72 20 6c 69 73 74 |roduced |for list|
|00001d70| 73 20 61 6e 64 20 73 69 | 6e 67 6c 65 20 65 6c 65 |s and si|ngle ele|
|00001d80| 6d 65 6e 74 73 2c 0a 65 | 76 65 6e 20 74 68 6f 75 |ments,.e|ven thou|
|00001d90| 67 68 20 74 68 65 79 20 | 61 72 65 20 65 71 75 69 |gh they |are equi|
|00001da0| 76 61 6c 65 6e 74 2e 0a | 5c 65 6e 64 7b 64 65 73 |valent..|\end{des|
|00001db0| 63 7d 0a 5c 62 65 67 69 | 6e 7b 76 65 72 62 61 74 |c}.\begi|n{verbat|
|00001dc0| 69 6d 7d 0a 52 65 63 3c | 74 79 70 65 3e 20 3d 20 |im}.Rec<|type> = |
|00001dd0| 72 65 63 6f 72 64 0a 20 | 20 20 20 6e 65 78 74 3a |record. | next:|
|00001de0| 20 3c 74 79 70 65 3e 6c | 69 73 74 3b 0a 20 20 20 | <type>l|ist;. |
|00001df0| 20 3c 65 6c 6d 6e 61 6d | 65 3e 3a 20 3c 65 6c 6d | <elmnam|e>: <elm|
|00001e00| 74 79 70 65 3e 3b 0a 20 | 20 20 20 3a 0a 20 20 20 |type>;. | :. |
|00001e10| 20 3c 65 6c 6d 6e 61 6d | 65 3e 3a 20 3c 65 6c 6d | <elmnam|e>: <elm|
|00001e20| 74 79 70 65 3e 3b 0a 65 | 6e 64 3b 0a 5c 65 6e 64 |type>;.e|nd;.\end|
|00001e30| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 5c 62 65 67 69 |{verbati|m}.\begi|
|00001e40| 6e 7b 64 65 73 63 7d 0a | 54 68 65 20 72 65 70 72 |n{desc}.|The repr|
|00001e50| 65 73 65 6e 74 61 74 69 | 6f 6e 20 6f 66 20 74 75 |esentati|on of tu|
|00001e60| 70 6c 65 20 74 79 70 65 | 73 2e 0a 54 68 65 20 7b |ple type|s..The {|
|00001e70| 5c 74 74 20 6e 65 78 74 | 7d 20 66 69 65 6c 64 20 |\tt next|} field |
|00001e80| 69 73 20 75 73 65 64 20 | 74 6f 20 63 72 65 61 74 |is used |to creat|
|00001e90| 65 20 6c 69 6e 6b 65 64 | 20 6c 69 73 74 73 20 6f |e linked| lists o|
|00001ea0| 66 20 7b 5c 74 74 20 3c | 74 79 70 65 3e 7d 20 65 |f {\tt <|type>} e|
|00001eb0| 6c 65 6d 65 6e 74 73 2e | 0a 5c 65 6e 64 7b 64 65 |lements.|.\end{de|
|00001ec0| 73 63 7d 0a 5c 62 65 67 | 69 6e 7b 76 65 72 62 61 |sc}.\beg|in{verba|
|00001ed0| 74 69 6d 7d 0a 41 6c 6c | 74 61 67 73 3c 74 79 70 |tim}.All|tags<typ|
|00001ee0| 65 3e 20 3d 20 28 20 54 | 61 67 3c 63 6f 6e 73 3e |e> = ( T|ag<cons>|
|00001ef0| 2c 20 2e 2e 2e 20 54 61 | 67 3c 63 6f 6e 73 3e 20 |, ... Ta|g<cons> |
|00001f00| 29 3b 0a 0a 52 65 63 3c | 74 79 70 65 3e 20 3d 20 |);..Rec<|type> = |
|00001f10| 72 65 63 6f 72 64 0a 20 | 20 20 20 6e 65 78 74 3a |record. | next:|
|00001f20| 20 3c 74 79 70 65 3e 6c | 69 73 74 3b 0a 20 20 20 | <type>l|ist;. |
|00001f30| 20 63 61 73 65 20 74 61 | 67 3a 20 41 6c 6c 74 61 | case ta|g: Allta|
|00001f40| 67 73 3c 74 79 70 65 3e | 20 6f 66 0a 20 20 20 20 |gs<type>| of. |
|00001f50| 20 20 20 20 54 61 67 3c | 63 6f 6e 73 3e 20 3a 28 | Tag<|cons> :(|
|00001f60| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 3c 65 6c |. | <el|
|00001f70| 6d 6e 61 6d 65 3e 3a 20 | 3c 65 6c 6d 74 79 70 65 |mname>: |<elmtype|
|00001f80| 3e 3b 0a 20 20 20 20 20 | 20 20 20 20 20 20 20 3a |>;. | :|
|00001f90| 0a 20 20 20 20 20 20 20 | 20 20 20 20 20 3c 65 6c |. | <el|
|00001fa0| 6d 6e 61 6d 65 3e 3a 20 | 3c 65 6c 6d 74 79 70 65 |mname>: |<elmtype|
|00001fb0| 3e 3b 0a 20 20 20 20 20 | 20 20 20 29 3b 0a 20 20 |>;. | );. |
|00001fc0| 20 20 65 6e 64 0a 65 6e | 64 3b 0a 5c 65 6e 64 7b | end.en|d;.\end{|
|00001fd0| 76 65 72 62 61 74 69 6d | 7d 0a 5c 62 65 67 69 6e |verbatim|}.\begin|
|00001fe0| 7b 64 65 73 63 7d 0a 54 | 68 65 20 72 65 70 72 65 |{desc}.T|he repre|
|00001ff0| 73 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 63 6f 6e |sentatio|n of con|
|00002000| 73 74 72 75 63 74 6f 72 | 20 74 79 70 65 73 2e 0a |structor| types..|
|00002010| 54 68 65 20 7b 5c 74 74 | 20 6e 65 78 74 7d 20 66 |The {\tt| next} f|
|00002020| 69 65 6c 64 20 69 73 20 | 75 73 65 64 20 74 6f 20 |ield is |used to |
|00002030| 63 72 65 61 74 65 20 6c | 69 6e 6b 65 64 20 6c 69 |create l|inked li|
|00002040| 73 74 73 20 6f 66 20 7b | 5c 74 74 20 3c 74 79 70 |sts of {|\tt <typ|
|00002050| 65 3e 7d 20 65 6c 65 6d | 65 6e 74 73 2e 0a 54 68 |e>} elem|ents..Th|
|00002060| 65 20 70 6f 73 73 69 62 | 6c 65 20 63 6f 6e 73 74 |e possib|le const|
|00002070| 72 75 63 74 6f 72 73 20 | 66 6f 72 20 74 68 65 20 |ructors |for the |
|00002080| 74 79 70 65 20 61 72 65 | 20 72 65 63 6f 67 6e 69 |type are| recogni|
|00002090| 7a 65 64 20 62 79 20 74 | 68 65 20 63 6f 6e 74 65 |zed by t|he conte|
|000020a0| 6e 74 73 20 6f 66 0a 74 | 68 65 20 7b 5c 74 74 20 |nts of.t|he {\tt |
|000020b0| 74 61 67 7d 20 66 69 65 | 6c 64 2c 0a 77 68 69 63 |tag} fie|ld,.whic|
|000020c0| 68 20 63 6f 6e 74 61 69 | 6e 73 20 61 20 76 61 6c |h contai|ns a val|
|000020d0| 75 65 20 6f 66 20 74 68 | 65 20 65 6e 75 6d 65 72 |ue of th|e enumer|
|000020e0| 61 74 65 64 20 74 79 70 | 65 20 7b 5c 74 74 20 41 |ated typ|e {\tt A|
|000020f0| 6c 6c 74 61 67 73 3c 74 | 79 70 65 3e 7d 2e 0a 46 |lltags<t|ype>}..F|
|00002100| 6f 72 20 65 61 63 68 20 | 63 6f 6e 73 74 72 75 63 |or each |construc|
|00002110| 74 6f 72 20 6f 66 20 61 | 20 76 61 72 69 61 6e 74 |tor of a| variant|
|00002120| 20 69 73 20 64 65 66 69 | 6e 65 64 2e 0a 5c 65 6e | is defi|ned..\en|
|00002130| 64 7b 64 65 73 63 7d 0a | 5c 73 75 62 73 65 63 74 |d{desc}.|\subsect|
|00002140| 69 6f 6e 7b 61 6c 6c 6f | 63 61 74 69 6f 6e 20 61 |ion{allo|cation a|
|00002150| 6e 64 20 66 72 65 65 69 | 6e 67 7d 0a 54 68 65 73 |nd freei|ng}.Thes|
|00002160| 65 20 70 72 6f 63 65 64 | 75 72 65 73 20 68 61 6e |e proced|ures han|
|00002170| 64 6c 65 20 61 6c 6c 6f | 63 61 74 69 6f 6e 20 61 |dle allo|cation a|
|00002180| 6e 64 20 66 72 65 65 69 | 6e 67 20 6f 66 20 69 6e |nd freei|ng of in|
|00002190| 73 74 61 6e 63 65 73 20 | 6f 66 20 74 68 65 20 63 |stances |of the c|
|000021a0| 6f 6e 73 74 72 75 63 74 | 6f 72 73 2e 0a 5c 62 65 |onstruct|ors..\be|
|000021b0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 70 72 |gin{verb|atim}.pr|
|000021c0| 6f 63 65 64 75 72 65 20 | 4e 65 77 3c 63 6f 6e 73 |ocedure |New<cons|
|000021d0| 3e 28 0a 20 20 20 20 65 | 31 3a 3c 65 6c 6d 74 79 |>(. e|1:<elmty|
|000021e0| 70 65 3e 3b 0a 20 20 20 | 20 3a 0a 20 20 20 20 65 |pe>;. | :. e|
|000021f0| 6e 3a 3c 65 6c 6d 74 79 | 70 65 3e 3b 0a 20 20 20 |n:<elmty|pe>;. |
|00002200| 20 76 61 72 20 6e 3a 3c | 74 79 70 65 3e 0a 29 3b | var n:<|type>.);|
|00002210| 0a 70 72 6f 63 65 64 75 | 72 65 20 4e 65 77 3c 74 |.procedu|re New<t|
|00002220| 79 70 65 3e 28 0a 20 20 | 20 20 65 31 3a 3c 65 6c |ype>(. | e1:<el|
|00002230| 6d 74 79 70 65 3e 3b 0a | 20 20 20 20 3a 0a 20 20 |mtype>;.| :. |
|00002240| 20 20 65 6e 3a 3c 65 6c | 6d 74 79 70 65 3e 3b 0a | en:<el|mtype>;.|
|00002250| 20 20 20 20 76 61 72 20 | 6e 3a 3c 74 79 70 65 3e | var |n:<type>|
|00002260| 0a 29 3b 0a 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 |.);.\end|{verbati|
|00002270| 6d 7d 0a 5c 62 65 67 69 | 6e 7b 64 65 73 63 7d 0a |m}.\begi|n{desc}.|
|00002280| 41 6c 6c 6f 63 61 74 65 | 20 73 70 61 63 65 20 66 |Allocate| space f|
|00002290| 6f 72 20 61 20 6e 65 77 | 20 6f 66 20 61 20 63 6f |or a new| of a co|
|000022a0| 6e 73 74 72 75 63 74 6f | 72 20 6f 72 20 74 75 70 |nstructo|r or tup|
|000022b0| 6c 65 20 72 65 63 6f 72 | 64 2c 0a 61 6e 64 20 73 |le recor|d,.and s|
|000022c0| 65 74 20 65 61 63 68 20 | 6f 66 20 74 68 65 20 65 |et each |of the e|
|000022d0| 6c 65 6d 65 6e 74 73 20 | 74 6f 20 74 68 65 20 76 |lements |to the v|
|000022e0| 61 6c 75 65 20 6f 66 20 | 74 68 65 20 67 69 76 65 |alue of |the give|
|000022f0| 6e 20 70 61 72 61 6d 65 | 74 65 72 0a 66 6f 72 20 |n parame|ter.for |
|00002300| 74 68 61 74 20 65 6c 65 | 6d 65 6e 74 2e 0a 53 65 |that ele|ment..Se|
|00002310| 74 20 74 68 65 20 66 69 | 72 73 74 20 70 61 72 61 |t the fi|rst para|
|00002320| 6d 65 74 65 72 20 28 7b | 5c 74 74 20 6e 7d 29 20 |meter ({|\tt n}) |
|00002330| 74 6f 20 74 68 65 20 6e | 65 77 20 72 65 63 6f 72 |to the n|ew recor|
|00002340| 64 2e 0a 54 68 65 20 7b | 5c 74 74 20 6e 65 78 74 |d..The {|\tt next|
|00002350| 7d 20 66 69 65 6c 64 20 | 69 73 20 73 65 74 20 74 |} field |is set t|
|00002360| 6f 20 7b 5c 74 74 20 6e | 69 6c 7d 2e 0a 46 6f 72 |o {\tt n|il}..For|
|00002370| 20 63 6f 6e 73 74 72 75 | 63 74 6f 72 73 20 74 68 | constru|ctors th|
|00002380| 65 20 7b 5c 74 74 20 74 | 61 67 7d 20 66 69 65 6c |e {\tt t|ag} fiel|
|00002390| 64 20 69 73 20 73 65 74 | 20 74 6f 20 7b 5c 74 74 |d is set| to {\tt|
|000023a0| 20 54 61 67 3c 63 6f 6e | 73 3e 7d 2e 0a 54 6f 20 | Tag<con|s>}..To |
|000023b0| 72 65 71 75 65 73 74 20 | 74 68 65 20 67 65 6e 65 |request |the gene|
|000023c0| 72 61 74 69 6f 6e 20 6f | 66 20 61 6c 6c 20 7b 5c |ration o|f all {\|
|000023d0| 74 74 20 4e 65 77 3c 63 | 6f 6e 73 3e 7d 20 66 75 |tt New<c|ons>} fu|
|000023e0| 6e 63 74 69 6f 6e 73 20 | 66 6f 72 20 61 20 63 65 |nctions |for a ce|
|000023f0| 72 74 61 69 6e 0a 63 6f | 6e 73 74 72 75 63 74 6f |rtain.co|nstructo|
|00002400| 72 20 74 79 70 65 2c 0a | 7b 5c 74 74 20 4e 65 77 |r type,.|{\tt New|
|00002410| 3c 74 79 70 65 3e 7d 20 | 6d 75 73 74 20 62 65 20 |<type>} |must be |
|00002420| 61 64 64 65 64 20 74 6f | 20 7b 5c 74 74 20 77 61 |added to| {\tt wa|
|00002430| 6e 74 64 65 66 73 7d 2c | 0a 73 65 65 20 73 65 63 |ntdefs},|.see sec|
|00002440| 74 69 6f 6e 20 5c 72 65 | 66 7b 73 65 63 3a 63 6f |tion \re|f{sec:co|
|00002450| 6e 66 69 67 7d 20 66 6f | 72 20 61 6e 20 65 78 70 |nfig} fo|r an exp|
|00002460| 6c 61 6e 61 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |lanation| of the |
|00002470| 75 73 65 20 6f 66 20 7b | 5c 74 74 20 77 61 6e 74 |use of {|\tt want|
|00002480| 64 65 66 73 7d 2e 0a 5c | 65 6e 64 7b 64 65 73 63 |defs}..\|end{desc|
|00002490| 7d 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |}.\begin|{verbati|
|000024a0| 6d 7d 0a 70 72 6f 63 65 | 64 75 72 65 20 46 72 65 |m}.proce|dure Fre|
|000024b0| 65 3c 74 79 70 65 3e 28 | 20 76 61 72 20 65 3a 20 |e<type>(| var e: |
|000024c0| 3c 74 79 70 65 3e 20 29 | 3b 0a 70 72 6f 63 65 64 |<type> )|;.proced|
|000024d0| 75 72 65 20 46 72 65 65 | 3c 74 79 70 65 3e 6c 69 |ure Free|<type>li|
|000024e0| 73 74 28 20 76 61 72 20 | 65 3a 20 3c 74 79 70 65 |st( var |e: <type|
|000024f0| 3e 6c 69 73 74 20 29 3b | 0a 5c 65 6e 64 7b 76 65 |>list );|.\end{ve|
|00002500| 72 62 61 74 69 6d 7d 0a | 5c 62 65 67 69 6e 7b 64 |rbatim}.|\begin{d|
|00002510| 65 73 63 7d 0a 46 72 65 | 65 20 61 6e 20 69 6e 73 |esc}.Fre|e an ins|
|00002520| 74 61 6e 63 65 20 6f 66 | 20 7b 5c 74 74 20 3c 74 |tance of| {\tt <t|
|00002530| 79 70 65 3e 7d 20 6f 72 | 20 7b 5c 74 74 20 3c 74 |ype>} or| {\tt <t|
|00002540| 79 70 65 3e 6c 69 73 74 | 7d 2e 0a 54 68 65 20 70 |ype>list|}..The p|
|00002550| 61 72 61 6d 65 74 65 72 | 20 7b 5c 74 74 20 65 7d |arameter| {\tt e}|
|00002560| 20 77 69 6c 6c 20 62 65 | 20 73 65 74 20 74 6f 20 | will be| set to |
|00002570| 7b 5c 74 74 20 6e 69 6c | 7d 2e 0a 5c 65 6e 64 7b |{\tt nil|}..\end{|
|00002580| 64 65 73 63 7d 0a 5c 62 | 65 67 69 6e 7b 76 65 72 |desc}.\b|egin{ver|
|00002590| 62 61 74 69 6d 7d 0a 70 | 72 6f 63 65 64 75 72 65 |batim}.p|rocedure|
|000025a0| 20 52 66 72 65 3c 74 79 | 70 65 3e 28 20 76 61 72 | Rfre<ty|pe>( var|
|000025b0| 20 65 3a 20 3c 74 79 70 | 65 3e 20 29 3b 0a 70 72 | e: <typ|e> );.pr|
|000025c0| 6f 63 65 64 75 72 65 20 | 52 66 72 65 3c 74 79 70 |ocedure |Rfre<typ|
|000025d0| 65 3e 6c 69 73 74 28 20 | 76 61 72 20 65 3a 20 3c |e>list( |var e: <|
|000025e0| 74 79 70 65 3e 6c 69 73 | 74 20 29 3b 0a 5c 65 6e |type>lis|t );.\en|
|000025f0| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0a 5c 62 65 67 |d{verbat|im}.\beg|
|00002600| 69 6e 7b 64 65 73 63 7d | 0a 52 65 63 75 72 73 69 |in{desc}|.Recursi|
|00002610| 76 65 6c 79 20 66 72 65 | 65 20 61 6e 20 69 6e 73 |vely fre|e an ins|
|00002620| 74 61 6e 63 65 20 6f 66 | 20 7b 5c 74 74 20 3c 74 |tance of| {\tt <t|
|00002630| 79 70 65 3e 7d 20 6f 72 | 20 7b 5c 74 74 20 3c 74 |ype>} or| {\tt <t|
|00002640| 79 70 65 3e 6c 69 73 74 | 7d 0a 61 6e 64 20 61 6c |ype>list|}.and al|
|00002650| 6c 20 65 6c 65 6d 65 6e | 74 73 20 69 6e 20 69 74 |l elemen|ts in it|
|00002660| 2e 0a 54 68 65 20 70 61 | 72 61 6d 65 74 65 72 20 |..The pa|rameter |
|00002670| 7b 5c 74 74 20 65 7d 20 | 77 69 6c 6c 20 62 65 20 |{\tt e} |will be |
|00002680| 73 65 74 20 74 6f 20 7b | 5c 74 74 20 6e 69 6c 7d |set to {|\tt nil}|
|00002690| 2e 0a 5c 65 6e 64 7b 64 | 65 73 63 7d 0a 5c 62 65 |..\end{d|esc}.\be|
|000026a0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 70 72 |gin{verb|atim}.pr|
|000026b0| 6f 63 65 64 75 72 65 20 | 53 74 61 74 3c 62 61 73 |ocedure |Stat<bas|
|000026c0| 65 6e 61 6d 65 3e 28 20 | 76 61 72 20 66 3a 20 74 |ename>( |var f: t|
|000026d0| 65 78 74 20 29 3b 0a 5c | 65 6e 64 7b 76 65 72 62 |ext );.\|end{verb|
|000026e0| 61 74 69 6d 7d 0a 5c 62 | 65 67 69 6e 7b 64 65 73 |atim}.\b|egin{des|
|000026f0| 63 7d 0a 57 72 69 74 65 | 20 73 74 61 74 69 73 74 |c}.Write| statist|
|00002700| 69 63 73 20 6f 66 20 61 | 6c 6c 6f 63 61 74 69 6f |ics of a|llocatio|
|00002710| 6e 20 61 6e 64 20 66 72 | 65 65 69 6e 67 20 74 6f |n and fr|eeing to|
|00002720| 20 66 69 6c 65 20 7b 5c | 74 74 20 66 7d 2e 0a 4e | file {\|tt f}..N|
|00002730| 6f 74 65 20 74 68 61 74 | 20 74 68 65 20 63 6f 64 |ote that| the cod|
|00002740| 65 20 74 6f 20 63 6f 6c | 6c 65 63 74 20 73 74 61 |e to col|lect sta|
|00002750| 74 69 73 74 69 63 73 20 | 69 73 20 6f 6e 6c 79 20 |tistics |is only |
|00002760| 67 65 6e 65 72 61 74 65 | 64 20 77 68 65 6e 20 74 |generate|d when t|
|00002770| 68 65 0a 67 65 6e 65 72 | 61 74 69 6f 6e 20 6f 66 |he.gener|ation of|
|00002780| 20 7b 5c 74 74 20 53 74 | 61 74 3c 62 61 73 65 6e | {\tt St|at<basen|
|00002790| 61 6d 65 3e 7d 20 68 61 | 73 20 62 65 65 6e 20 72 |ame>} ha|s been r|
|000027a0| 65 71 75 65 73 74 65 64 | 2e 0a 5c 65 6e 64 7b 64 |equested|..\end{d|
|000027b0| 65 73 63 7d 0a 5c 73 75 | 62 73 65 63 74 69 6f 6e |esc}.\su|bsection|
|000027c0| 7b 61 70 70 65 6e 64 69 | 6e 67 20 61 6e 64 20 63 |{appendi|ng and c|
|000027d0| 6f 6e 63 61 74 65 6e 61 | 74 69 6f 6e 7d 0a 54 68 |oncatena|tion}.Th|
|000027e0| 65 73 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 68 61 |ese func|tions ha|
|000027f0| 6e 64 6c 65 20 61 70 70 | 65 6e 64 69 6e 67 20 28 |ndle app|ending (|
|00002800| 61 64 64 69 6e 67 20 73 | 69 6e 67 6c 65 20 65 6c |adding s|ingle el|
|00002810| 65 6d 65 6e 74 73 20 61 | 74 20 74 68 65 20 65 6e |ements a|t the en|
|00002820| 64 20 6f 66 20 74 68 65 | 20 6c 69 73 74 29 0a 61 |d of the| list).a|
|00002830| 6e 64 20 63 6f 6e 63 61 | 74 65 6e 61 74 69 6f 6e |nd conca|tenation|
|00002840| 20 28 61 64 64 69 6e 67 | 20 61 20 6c 69 73 74 20 | (adding| a list |
|00002850| 61 74 20 74 68 65 20 65 | 6e 64 20 6f 66 20 61 6e |at the e|nd of an|
|00002860| 20 6f 74 68 65 72 20 6c | 69 73 74 29 2e 0a 53 69 | other l|ist)..Si|
|00002870| 6e 63 65 20 61 6c 6c 20 | 73 69 6e 67 6c 65 20 65 |nce all |single e|
|00002880| 6c 65 6d 65 6e 74 73 20 | 68 61 76 65 20 74 68 65 |lements |have the|
|00002890| 69 72 20 7b 5c 74 74 20 | 6e 65 78 74 7d 20 66 69 |ir {\tt |next} fi|
|000028a0| 65 6c 64 20 73 65 74 20 | 74 6f 20 7b 5c 74 74 20 |eld set |to {\tt |
|000028b0| 6e 69 6c 7d 0a 62 79 20 | 74 68 65 20 7b 5c 74 74 |nil}.by |the {\tt|
|000028c0| 20 4e 65 77 3c 63 6f 6e | 73 3e 7d 20 6f 72 20 7b | New<con|s>} or {|
|000028d0| 5c 74 74 20 4e 65 77 3c | 74 79 70 65 3e 7d 20 66 |\tt New<|type>} f|
|000028e0| 75 6e 63 74 69 6f 6e 2c | 0a 62 6f 74 68 20 63 6c |unction,|.both cl|
|000028f0| 61 73 73 65 73 20 6f 66 | 20 66 75 6e 63 74 69 6f |asses of| functio|
|00002900| 6e 73 20 61 63 74 75 61 | 6c 6c 79 20 75 73 65 20 |ns actua|lly use |
|00002910| 74 68 65 20 73 61 6d 65 | 20 63 6f 64 65 2e 0a 5c |the same| code..\|
|00002920| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0a |begin{ve|rbatim}.|
|00002930| 66 75 6e 63 74 69 6f 6e | 20 41 70 70 3c 74 79 70 |function| App<typ|
|00002940| 65 3e 28 20 76 61 72 20 | 6c 3a 20 3c 74 79 70 65 |e>( var |l: <type|
|00002950| 3e 6c 69 73 74 3b 20 65 | 3a 20 3c 74 79 70 65 3e |>list; e|: <type>|
|00002960| 20 29 3a 20 3c 74 79 70 | 65 3e 3b 0a 5c 65 6e 64 | ): <typ|e>;.\end|
|00002970| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 5c 62 65 67 69 |{verbati|m}.\begi|
|00002980| 6e 7b 64 65 73 63 7d 0a | 41 70 70 65 6e 64 20 65 |n{desc}.|Append e|
|00002990| 6c 65 6d 65 6e 74 20 7b | 5c 74 74 20 65 7d 20 61 |lement {|\tt e} a|
|000029a0| 66 74 65 72 20 6c 69 73 | 74 20 7b 5c 74 74 20 6c |fter lis|t {\tt l|
|000029b0| 7d 2c 0a 61 6e 64 20 72 | 65 74 75 72 6e 20 74 68 |},.and r|eturn th|
|000029c0| 65 20 6e 65 77 20 6c 69 | 73 74 2e 0a 52 65 6d 61 |e new li|st..Rema|
|000029d0| 69 6e 69 6e 67 20 63 6f | 70 69 65 73 20 74 6f 20 |ining co|pies to |
|000029e0| 74 68 65 20 70 61 72 61 | 6d 65 74 65 72 73 20 7b |the para|meters {|
|000029f0| 5c 74 74 20 6c 7d 20 61 | 6e 64 20 7b 5c 74 74 20 |\tt l} a|nd {\tt |
|00002a00| 65 7d 20 61 72 65 20 73 | 74 69 6c 6c 20 76 61 6c |e} are s|till val|
|00002a10| 69 64 2c 0a 62 75 74 20 | 6f 6e 6c 79 20 74 68 65 |id,.but |only the|
|00002a20| 20 63 6f 6d 70 6c 65 74 | 65 20 63 6f 6e 73 74 72 | complet|e constr|
|00002a30| 75 63 74 65 64 20 6c 69 | 73 74 20 73 68 6f 75 6c |ucted li|st shoul|
|00002a40| 64 20 62 65 20 66 72 65 | 65 64 2e 0a 54 68 65 20 |d be fre|ed..The |
|00002a50| 66 75 6e 63 74 69 6f 6e | 20 62 65 68 61 76 65 73 |function| behaves|
|00002a60| 20 63 6f 72 72 65 63 74 | 6c 79 20 69 66 20 7b 5c | correct|ly if {\|
|00002a70| 74 74 20 6c 7d 20 6f 72 | 20 7b 5c 74 74 20 65 7d |tt l} or| {\tt e}|
|00002a80| 20 69 73 20 7b 5c 74 74 | 20 6e 69 6c 7d 2e 0a 5c | is {\tt| nil}..\|
|00002a90| 65 6e 64 7b 64 65 73 63 | 7d 0a 5c 73 75 62 73 65 |end{desc|}.\subse|
|00002aa0| 63 74 69 6f 6e 7b 72 65 | 63 75 72 73 69 76 65 20 |ction{re|cursive |
|00002ab0| 63 6f 70 79 69 6e 67 7d | 0a 54 68 65 73 65 20 66 |copying}|.These f|
|00002ac0| 75 6e 63 74 69 6f 6e 73 | 20 68 61 6e 64 6c 65 20 |unctions| handle |
|00002ad0| 72 65 63 75 72 73 69 76 | 65 20 63 6f 70 79 69 6e |recursiv|e copyin|
|00002ae0| 67 20 6f 66 20 69 6e 73 | 74 61 6e 63 65 73 20 6f |g of ins|tances o|
|00002af0| 66 20 74 79 70 65 73 0a | 61 6e 64 20 6c 69 73 74 |f types.|and list|
|00002b00| 73 20 6f 66 20 74 79 70 | 65 73 2e 0a 43 6f 70 79 |s of typ|es..Copy|
|00002b10| 69 6e 67 20 6d 65 61 6e | 73 20 74 68 61 74 20 6e |ing mean|s that n|
|00002b20| 65 77 20 69 6e 73 74 61 | 6e 63 65 73 20 61 72 65 |ew insta|nces are|
|00002b30| 20 61 6c 6c 6f 63 61 74 | 65 64 20 66 6f 72 20 74 | allocat|ed for t|
|00002b40| 79 70 65 73 20 74 68 61 | 74 20 6d 75 73 74 0a 62 |ypes tha|t must.b|
|00002b50| 65 20 61 6c 6c 6f 63 61 | 74 65 64 2e 0a 5c 62 65 |e alloca|ted..\be|
|00002b60| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 66 75 |gin{verb|atim}.fu|
|00002b70| 6e 63 74 69 6f 6e 20 43 | 6f 70 79 3c 74 79 70 65 |nction C|opy<type|
|00002b80| 3e 28 20 3c 74 79 70 65 | 3e 20 65 20 29 3a 20 3c |>( <type|> e ): <|
|00002b90| 74 79 70 65 3e 3b 0a 66 | 75 6e 63 74 69 6f 6e 20 |type>;.f|unction |
|00002ba0| 43 6f 70 79 3c 74 79 70 | 65 3e 6c 69 73 74 28 20 |Copy<typ|e>list( |
|00002bb0| 3c 74 79 70 65 3e 6c 69 | 73 74 20 65 20 29 3a 20 |<type>li|st e ): |
|00002bc0| 3c 74 79 70 65 3e 6c 69 | 73 74 3b 0a 5c 65 6e 64 |<type>li|st;.\end|
|00002bd0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 5c 62 65 67 69 |{verbati|m}.\begi|
|00002be0| 6e 7b 64 65 73 63 7d 0a | 52 65 63 75 72 73 69 76 |n{desc}.|Recursiv|
|00002bf0| 65 6c 79 20 63 6f 70 79 | 20 69 6e 73 74 61 6e 63 |ely copy| instanc|
|00002c00| 65 20 7b 5c 74 74 20 65 | 7d 20 6f 66 20 74 79 70 |e {\tt e|} of typ|
|00002c10| 65 20 7b 5c 74 74 20 3c | 74 79 70 65 3e 7d 20 6f |e {\tt <|type>} o|
|00002c20| 72 0a 7b 5c 74 74 20 3c | 74 79 70 65 3e 6c 69 73 |r.{\tt <|type>lis|
|00002c30| 74 7d 2e 0a 5c 65 6e 64 | 7b 64 65 73 63 7d 0a 5c |t}..\end|{desc}.\|
|00002c40| 73 75 62 73 65 63 74 69 | 6f 6e 7b 69 6e 70 75 74 |subsecti|on{input|
|00002c50| 20 61 6e 64 20 6f 75 74 | 70 75 74 7d 0a 54 68 65 | and out|put}.The|
|00002c60| 73 65 20 66 75 6e 63 74 | 69 6f 6e 73 20 68 61 6e |se funct|ions han|
|00002c70| 64 6c 65 20 72 65 61 64 | 69 6e 67 20 61 6e 64 20 |dle read|ing and |
|00002c80| 77 72 69 74 69 6e 67 20 | 6f 66 20 61 20 74 65 78 |writing |of a tex|
|00002c90| 74 75 61 6c 20 64 65 73 | 63 72 69 70 74 69 6f 6e |tual des|cription|
|00002ca0| 20 6f 66 20 74 68 65 0a | 64 61 74 61 73 74 72 75 | of the.|datastru|
|00002cb0| 63 74 75 72 65 73 2e 0a | 54 68 65 79 20 61 73 73 |ctures..|They ass|
|00002cc0| 75 6d 65 20 74 68 65 20 | 65 78 69 73 74 65 6e 63 |ume the |existenc|
|00002cd0| 65 20 6f 66 20 74 68 65 | 20 66 6f 6c 6c 6f 77 69 |e of the| followi|
|00002ce0| 6e 67 20 66 75 6e 63 74 | 69 6f 6e 73 3a 0a 5c 62 |ng funct|ions:.\b|
|00002cf0| 65 67 69 6e 7b 66 6c 75 | 73 68 6c 65 66 74 7d 0a |egin{flu|shleft}.|
|00002d00| 5c 62 65 67 69 6e 7b 74 | 61 62 75 6c 61 72 7d 7b |\begin{t|abular}{|
|00002d10| 7c 6c 7c 6c 7c 7d 0a 5c | 68 6c 69 6e 65 0a 6e 61 ||l|l|}.\|hline.na|
|00002d20| 6d 65 20 26 20 70 75 72 | 70 6f 73 65 20 5c 5c 0a |me & pur|pose \\.|
|00002d30| 5c 68 6c 69 6e 65 0a 7b | 5c 74 74 20 74 6d 67 65 |\hline.{|\tt tmge|
|00002d40| 74 63 7d 20 26 20 20 52 | 65 61 64 20 6e 65 78 74 |tc} & R|ead next|
|00002d50| 20 63 68 61 72 20 6f 66 | 20 61 20 74 65 78 74 20 | char of| a text |
|00002d60| 66 69 6c 65 2e 20 5c 5c | 0a 7b 5c 74 74 20 74 6d |file. \\|.{\tt tm|
|00002d70| 72 65 61 64 73 70 63 7d | 20 26 20 53 6b 69 70 20 |readspc}| & Skip |
|00002d80| 73 70 61 63 65 73 20 61 | 6e 64 20 63 6f 6d 6d 65 |spaces a|nd comme|
|00002d90| 6e 74 2e 20 5c 5c 0a 7b | 5c 74 74 20 74 6d 6e 65 |nt. \\.{|\tt tmne|
|00002da0| 65 64 63 7d 20 26 20 45 | 78 70 65 63 74 20 67 69 |edc} & E|xpect gi|
|00002db0| 76 65 6e 20 63 68 61 72 | 20 69 6e 20 66 69 6c 65 |ven char| in file|
|00002dc0| 2e 20 5c 5c 0a 7b 5c 74 | 74 20 74 6d 72 65 61 64 |. \\.{\t|t tmread|
|00002dd0| 6f 62 72 61 63 7d 20 26 | 20 43 6f 75 6e 74 20 6f |obrac} &| Count o|
|00002de0| 70 65 6e 20 62 72 61 63 | 6b 65 74 73 2e 20 5c 5c |pen brac|kets. \\|
|00002df0| 0a 7b 5c 74 74 20 74 6d | 72 65 61 64 63 62 72 61 |.{\tt tm|readcbra|
|00002e00| 63 7d 20 26 20 42 61 6c | 61 6e 63 65 20 6f 70 65 |c} & Bal|ance ope|
|00002e10| 6e 20 62 72 61 63 6b 65 | 74 73 2e 20 5c 5c 0a 5c |n bracke|ts. \\.\|
|00002e20| 68 6c 69 6e 65 0a 5c 65 | 6e 64 7b 74 61 62 75 6c |hline.\e|nd{tabul|
|00002e30| 61 72 7d 0a 5c 65 6e 64 | 7b 66 6c 75 73 68 6c 65 |ar}.\end|{flushle|
|00002e40| 66 74 7d 0a 53 65 65 20 | 73 65 63 74 69 6f 6e 20 |ft}.See |section |
|00002e50| 5c 72 65 66 7b 73 65 63 | 3a 6c 69 62 7d 20 66 6f |\ref{sec|:lib} fo|
|00002e60| 72 20 61 20 64 65 74 61 | 69 6c 65 64 20 64 65 73 |r a deta|iled des|
|00002e70| 63 72 69 70 74 69 6f 6e | 2e 0a 5c 70 61 72 0a 54 |cription|..\par.T|
|00002e80| 68 65 20 7b 5c 74 74 20 | 52 65 61 64 3c 74 79 70 |he {\tt |Read<typ|
|00002e90| 65 3e 7d 2c 20 7b 5c 74 | 74 20 52 65 61 64 3c 74 |e>}, {\t|t Read<t|
|00002ea0| 79 70 65 3e 6c 69 73 74 | 7d 20 61 6e 64 20 73 75 |ype>list|} and su|
|00002eb0| 70 70 6f 72 74 69 6e 67 | 20 72 6f 75 74 69 6e 65 |pporting| routine|
|00002ec0| 73 0a 61 73 73 75 6d 65 | 20 74 68 65 20 65 78 69 |s.assume| the exi|
|00002ed0| 73 74 65 6e 63 65 20 6f | 66 20 61 20 66 65 77 20 |stence o|f a few |
|00002ee0| 76 61 72 69 61 62 6c 65 | 73 3a 0a 5c 62 65 67 69 |variable|s:.\begi|
|00002ef0| 6e 7b 66 6c 75 73 68 6c | 65 66 74 7d 0a 5c 62 65 |n{flushl|eft}.\be|
|00002f00| 67 69 6e 7b 74 61 62 75 | 6c 61 72 2a 7d 7b 5c 74 |gin{tabu|lar*}{\t|
|00002f10| 65 78 74 77 69 64 74 68 | 7d 7b 6c 40 7b 5c 65 78 |extwidth|}{l@{\ex|
|00002f20| 74 72 61 63 6f 6c 73 65 | 70 7b 5c 66 69 6c 6c 7d |tracolse|p{\fill}|
|00002f30| 7d 70 7b 5c 64 65 73 63 | 77 69 64 74 68 7d 7d 0a |}p{\desc|width}}.|
|00002f40| 7b 5c 74 74 20 74 6d 63 | 75 72 63 68 61 72 7d 0a |{\tt tmc|urchar}.|
|00002f50| 26 0a 54 68 69 73 20 76 | 61 72 69 61 62 6c 65 20 |&.This v|ariable |
|00002f60| 6d 75 73 74 20 63 6f 6e | 74 61 69 6e 20 74 68 65 |must con|tain the|
|00002f70| 20 66 69 72 73 74 20 63 | 68 61 72 61 63 74 65 72 | first c|haracter|
|00002f80| 20 74 6f 20 75 73 65 20 | 66 6f 72 20 61 6c 6c 20 | to use |for all |
|00002f90| 72 65 61 64 0a 66 75 6e | 63 74 69 6f 6e 73 2e 0a |read.fun|ctions..|
|00002fa0| 41 6c 6c 20 72 65 61 64 | 20 66 75 6e 63 74 69 6f |All read| functio|
|00002fb0| 6e 73 20 63 61 6e 20 61 | 73 73 75 6d 65 20 74 68 |ns can a|ssume th|
|00002fc0| 61 74 20 69 74 20 69 73 | 20 66 69 6c 6c 65 64 20 |at it is| filled |
|00002fd0| 6f 6e 20 65 6e 74 72 79 | 2c 0a 61 6e 64 20 6d 75 |on entry|,.and mu|
|00002fe0| 73 74 20 65 6e 73 75 72 | 65 20 74 68 61 74 20 69 |st ensur|e that i|
|00002ff0| 74 20 69 73 20 66 69 6c | 6c 65 64 20 6f 6e 20 65 |t is fil|led on e|
|00003000| 78 69 74 2e 0a 5c 70 61 | 72 0a 54 68 69 73 20 69 |xit..\pa|r.This i|
|00003010| 6d 70 6c 69 65 73 20 74 | 68 61 74 20 62 65 66 6f |mplies t|hat befo|
|00003020| 72 65 20 74 68 65 20 74 | 6f 70 20 6c 65 76 65 6c |re the t|op level|
|00003030| 20 7b 5c 74 74 20 52 65 | 61 64 3c 74 79 70 65 3e | {\tt Re|ad<type>|
|00003040| 7d 20 66 75 6e 63 74 69 | 6f 6e 20 69 73 20 75 73 |} functi|on is us|
|00003050| 65 64 2c 0a 74 68 65 20 | 76 61 72 69 61 62 6c 65 |ed,.the |variable|
|00003060| 20 6d 75 73 74 20 62 65 | 20 66 69 6c 6c 65 64 20 | must be| filled |
|00003070| 77 69 74 68 20 61 20 63 | 61 6c 6c 20 74 6f 20 7b |with a c|all to {|
|00003080| 5c 74 74 20 74 6d 67 65 | 74 63 7d 0a 28 73 65 65 |\tt tmge|tc}.(see|
|00003090| 20 73 65 63 74 69 6f 6e | 20 5c 72 65 66 7b 73 65 | section| \ref{se|
|000030a0| 63 3a 6c 69 62 7d 29 2e | 0a 5c 5c 0a 7b 5c 74 74 |c:lib}).|.\\.{\tt|
|000030b0| 20 74 6d 65 6f 6c 6e 63 | 68 61 72 7d 0a 26 0a 53 | tmeolnc|har}.&.S|
|000030c0| 70 65 63 69 61 6c 20 63 | 68 61 72 20 66 6f 72 20 |pecial c|har for |
|000030d0| 74 68 65 20 65 6f 6c 6e | 20 63 6f 6e 64 69 74 69 |the eoln| conditi|
|000030e0| 6f 6e 20 61 73 20 75 73 | 65 64 20 69 6e 20 7b 5c |on as us|ed in {\|
|000030f0| 70 61 73 63 61 6c 7d 2e | 0a 5c 5c 0a 7b 5c 74 74 |pascal}.|.\\.{\tt|
|00003100| 20 74 6d 65 6f 66 63 68 | 61 72 7d 0a 26 0a 53 70 | tmeofch|ar}.&.Sp|
|00003110| 65 63 69 61 6c 20 63 68 | 61 72 20 66 6f 72 20 74 |ecial ch|ar for t|
|00003120| 68 65 20 65 6f 66 20 63 | 6f 6e 64 69 74 69 6f 6e |he eof c|ondition|
|00003130| 20 61 73 20 75 73 65 64 | 20 69 6e 20 7b 5c 70 61 | as used| in {\pa|
|00003140| 73 63 61 6c 7d 2e 0a 5c | 65 6e 64 7b 74 61 62 75 |scal}..\|end{tabu|
|00003150| 6c 61 72 2a 7d 0a 5c 65 | 6e 64 7b 66 6c 75 73 68 |lar*}.\e|nd{flush|
|00003160| 6c 65 66 74 7d 0a 5c 70 | 61 72 0a 54 68 65 20 76 |left}.\p|ar.The v|
|00003170| 61 72 69 61 62 6c 65 73 | 20 7b 5c 74 74 20 74 6d |ariables| {\tt tm|
|00003180| 65 6f 6c 6e 63 68 61 72 | 7d 20 61 6e 64 20 7b 5c |eolnchar|} and {\|
|00003190| 74 74 20 74 6d 65 6f 66 | 63 68 61 72 7d 20 61 72 |tt tmeof|char} ar|
|000031a0| 65 0a 73 65 74 20 74 6f | 20 74 68 65 69 72 20 76 |e.set to| their v|
|000031b0| 61 6c 75 65 20 69 6e 20 | 74 68 65 20 70 72 6f 63 |alue in |the proc|
|000031c0| 65 64 75 72 65 20 7b 5c | 74 74 20 49 6e 69 74 3c |edure {\|tt Init<|
|000031d0| 62 61 73 65 6e 61 6d 65 | 3e 7d 2e 0a 5c 62 65 67 |basename|>}..\beg|
|000031e0| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0a 66 75 6e |in{verba|tim}.fun|
|000031f0| 63 74 69 6f 6e 20 52 65 | 61 64 3c 74 79 70 65 3e |ction Re|ad<type>|
|00003200| 28 20 76 61 72 20 66 2c | 20 72 66 3a 20 74 65 78 |( var f,| rf: tex|
|00003210| 74 3b 20 76 61 72 20 70 | 3a 20 3c 74 79 70 65 3e |t; var p|: <type>|
|00003220| 20 29 3b 0a 66 75 6e 63 | 74 69 6f 6e 20 52 65 61 | );.func|tion Rea|
|00003230| 64 3c 74 79 70 65 3e 6c | 69 73 74 28 20 76 61 72 |d<type>l|ist( var|
|00003240| 20 66 2c 20 72 66 3a 20 | 74 65 78 74 3b 20 76 61 | f, rf: |text; va|
|00003250| 72 20 70 3a 20 3c 74 79 | 70 65 3e 6c 69 73 74 20 |r p: <ty|pe>list |
|00003260| 29 3b 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |);.\end{|verbatim|
|00003270| 7d 0a 5c 62 65 67 69 6e | 7b 64 65 73 63 7d 0a 52 |}.\begin|{desc}.R|
|00003280| 65 61 64 20 61 6e 20 69 | 6e 73 74 61 6e 63 65 20 |ead an i|nstance |
|00003290| 6f 66 20 72 65 63 6f 72 | 64 20 7b 5c 74 74 20 3c |of recor|d {\tt <|
|000032a0| 74 79 70 65 3e 7d 20 6f | 72 20 7b 5c 74 74 20 3c |type>} o|r {\tt <|
|000032b0| 74 79 70 65 3e 6c 69 73 | 74 7d 20 66 72 6f 6d 0a |type>lis|t} from.|
|000032c0| 66 69 6c 65 20 7b 5c 74 | 74 20 66 7d 2c 0a 61 6c |file {\t|t f},.al|
|000032d0| 6c 6f 63 61 74 65 20 6d | 65 6d 6f 72 79 20 74 6f |locate m|emory to|
|000032e0| 20 68 6f 6c 64 20 74 68 | 65 20 64 61 74 61 20 74 | hold th|e data t|
|000032f0| 68 61 74 20 69 73 20 72 | 65 61 64 2c 0a 61 6e 64 |hat is r|ead,.and|
|00003300| 20 73 65 74 20 7b 5c 74 | 74 20 70 7d 20 74 6f 20 | set {\t|t p} to |
|00003310| 74 68 65 20 6e 65 77 20 | 64 61 74 61 2e 0a 49 66 |the new |data..If|
|00003320| 20 6e 6f 20 65 72 72 6f | 72 20 6f 63 63 75 72 73 | no erro|r occurs|
|00003330| 2c 20 61 20 76 61 6c 75 | 65 20 7b 5c 74 74 20 66 |, a valu|e {\tt f|
|00003340| 61 6c 73 65 7d 20 69 73 | 20 72 65 74 75 72 6e 65 |alse} is| returne|
|00003350| 64 2e 0a 49 66 20 61 6e | 20 65 72 72 6f 72 20 6f |d..If an| error o|
|00003360| 63 63 75 72 73 20 64 75 | 72 69 6e 67 20 72 65 61 |ccurs du|ring rea|
|00003370| 64 69 6e 67 2c 0a 61 20 | 76 61 6c 75 65 20 7b 5c |ding,.a |value {\|
|00003380| 74 74 20 74 72 75 65 7d | 20 69 73 20 72 65 74 75 |tt true}| is retu|
|00003390| 72 6e 65 64 2c 20 61 6e | 64 20 61 6e 20 65 72 72 |rned, an|d an err|
|000033a0| 6f 72 20 6d 65 73 73 61 | 67 65 20 69 73 20 77 72 |or messa|ge is wr|
|000033b0| 69 74 74 65 6e 0a 74 6f | 20 74 68 65 20 66 69 6c |itten.to| the fil|
|000033c0| 65 20 7b 5c 74 74 20 72 | 66 7d 2e 0a 46 6f 72 20 |e {\tt r|f}..For |
|000033d0| 61 6c 6c 20 74 68 65 20 | 64 61 74 61 20 74 68 61 |all the |data tha|
|000033e0| 74 20 68 61 73 20 62 65 | 65 6e 20 72 65 61 64 20 |t has be|en read |
|000033f0| 62 65 66 6f 72 65 20 74 | 68 65 20 65 72 72 6f 72 |before t|he error|
|00003400| 20 6d 65 6d 6f 72 79 20 | 69 73 20 61 6c 6c 6f 63 | memory |is alloc|
|00003410| 61 74 65 64 2c 0a 62 75 | 74 20 74 68 65 20 61 6c |ated,.bu|t the al|
|00003420| 6c 6f 63 61 74 65 64 20 | 72 65 63 6f 72 64 73 20 |located |records |
|00003430| 6d 61 79 20 63 6f 6e 74 | 61 69 6e 20 67 61 72 62 |may cont|ain garb|
|00003440| 61 67 65 20 76 61 6c 75 | 65 73 20 66 6f 72 20 74 |age valu|es for t|
|00003450| 68 65 20 72 65 63 6f 72 | 64 0a 65 6c 65 6d 65 6e |he recor|d.elemen|
|00003460| 74 73 20 74 68 61 74 20 | 63 6f 75 6c 64 20 6e 6f |ts that |could no|
|00003470| 74 20 62 65 20 72 65 61 | 64 20 64 75 65 20 74 6f |t be rea|d due to|
|00003480| 20 74 68 65 20 65 72 72 | 6f 72 2e 0a 5c 65 6e 64 | the err|or..\end|
|00003490| 7b 64 65 73 63 7d 0a 5c | 62 65 67 69 6e 7b 76 65 |{desc}.\|begin{ve|
|000034a0| 72 62 61 74 69 6d 7d 0a | 70 72 6f 63 65 64 75 72 |rbatim}.|procedur|
|000034b0| 65 20 57 72 69 74 65 3c | 74 79 70 65 3e 28 20 76 |e Write<|type>( v|
|000034c0| 61 72 20 66 3a 20 74 65 | 78 74 3b 20 74 3a 20 3c |ar f: te|xt; t: <|
|000034d0| 74 79 70 65 3e 20 29 3b | 0a 70 72 6f 63 65 64 75 |type> );|.procedu|
|000034e0| 72 65 20 57 72 69 74 65 | 3c 74 79 70 65 3e 6c 69 |re Write|<type>li|
|000034f0| 73 74 28 20 76 61 72 20 | 66 3a 20 74 65 78 74 2c |st( var |f: text,|
|00003500| 20 74 3a 20 3c 74 79 70 | 65 3e 6c 69 73 74 20 29 | t: <typ|e>list )|
|00003510| 3b 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |;.\end{v|erbatim}|
|00003520| 0a 5c 62 65 67 69 6e 7b | 64 65 73 63 7d 0a 57 72 |.\begin{|desc}.Wr|
|00003530| 69 74 65 20 61 6e 20 69 | 6e 73 74 61 6e 63 65 20 |ite an i|nstance |
|00003540| 6f 66 20 72 65 63 6f 72 | 64 20 7b 5c 74 74 20 3c |of recor|d {\tt <|
|00003550| 74 79 70 65 3e 7d 20 6f | 72 20 7b 5c 74 74 20 3c |type>} o|r {\tt <|
|00003560| 74 79 70 65 3e 6c 69 73 | 74 7d 0a 74 6f 20 66 69 |type>lis|t}.to fi|
|00003570| 6c 65 20 7b 5c 74 74 20 | 66 7d 20 69 6e 20 74 68 |le {\tt |f} in th|
|00003580| 65 20 69 6e 74 65 72 6e | 61 6c 20 72 65 70 72 65 |e intern|al repre|
|00003590| 73 65 6e 74 61 74 69 6f | 6e 20 6f 66 20 7b 5c 74 |sentatio|n of {\t|
|000035a0| 6d 7d 2e 0a 5c 65 6e 64 | 7b 64 65 73 63 7d 0a 5c |m}..\end|{desc}.\|
|000035b0| 73 75 62 73 65 63 74 69 | 6f 6e 7b 63 6f 6d 70 61 |subsecti|on{compa|
|000035c0| 72 69 73 6f 6e 7d 0a 54 | 68 65 73 65 20 66 75 6e |rison}.T|hese fun|
|000035d0| 63 74 69 6f 6e 73 20 68 | 61 6e 64 6c 65 20 72 65 |ctions h|andle re|
|000035e0| 63 75 72 73 69 76 65 20 | 63 6f 6d 70 61 72 69 73 |cursive |comparis|
|000035f0| 6f 6e 20 6f 66 20 73 74 | 72 75 63 74 75 72 65 73 |on of st|ructures|
|00003600| 2e 0a 47 69 76 65 6e 20 | 74 77 6f 20 64 61 74 61 |..Given |two data|
|00003610| 73 74 72 75 63 74 75 72 | 65 73 20 7b 5c 74 74 20 |structur|es {\tt |
|00003620| 61 7d 20 61 6e 64 20 7b | 5c 74 74 20 62 7d 2c 0a |a} and {|\tt b},.|
|00003630| 61 6e 20 69 6e 74 65 67 | 65 72 20 24 7b 5c 74 74 |an integ|er ${\tt|
|00003640| 20 6e 7d 3c 30 24 20 69 | 73 20 72 65 74 75 72 6e | n}<0$ i|s return|
|00003650| 65 64 20 69 66 20 24 7b | 5c 74 74 20 61 7d 3c 7b |ed if ${|\tt a}<{|
|00003660| 5c 74 74 20 62 7d 24 2c | 0a 30 20 69 66 20 24 7b |\tt b}$,|.0 if ${|
|00003670| 5c 74 74 20 61 7d 3d 7b | 5c 74 74 20 62 7d 24 2c |\tt a}={|\tt b}$,|
|00003680| 0a 61 6e 64 20 61 6e 20 | 69 6e 74 65 67 65 72 20 |.and an |integer |
|00003690| 24 7b 5c 74 74 20 6e 7d | 3e 30 24 20 69 66 20 24 |${\tt n}|>0$ if $|
|000036a0| 7b 5c 74 74 20 61 7d 3e | 7b 5c 74 74 20 62 7d 24 |{\tt a}>|{\tt b}$|
|000036b0| 2c 0a 5c 70 61 72 0a 46 | 6f 72 20 63 6f 6d 70 61 |,.\par.F|or compa|
|000036c0| 72 69 73 6f 6e 20 74 68 | 65 20 66 6f 6c 6c 6f 77 |rison th|e follow|
|000036d0| 69 6e 67 20 72 75 6c 65 | 73 20 61 72 65 20 61 70 |ing rule|s are ap|
|000036e0| 70 6c 69 65 64 3a 0a 5c | 62 65 67 69 6e 7b 69 74 |plied:.\|begin{it|
|000036f0| 65 6d 69 7a 65 7d 0a 5c | 69 74 65 6d 0a 54 75 70 |emize}.\|item.Tup|
|00003700| 6c 65 73 20 61 72 65 20 | 65 71 75 61 6c 20 69 66 |les are |equal if|
|00003710| 20 61 6c 6c 20 74 68 65 | 69 72 20 65 6c 65 6d 65 | all the|ir eleme|
|00003720| 6e 74 73 20 61 72 65 20 | 65 71 75 61 6c 2c 0a 65 |nts are |equal,.e|
|00003730| 6c 73 65 20 74 68 65 20 | 66 69 72 73 74 20 64 69 |lse the |first di|
|00003740| 66 66 65 72 69 6e 67 20 | 65 6c 65 6d 65 6e 74 20 |ffering |element |
|00003750| 66 72 6f 6d 20 74 68 65 | 20 6c 65 66 74 20 64 65 |from the| left de|
|00003760| 74 65 72 6d 69 6e 65 73 | 20 74 68 65 20 63 6f 6d |termines| the com|
|00003770| 70 61 72 69 73 6f 6e 2e | 0a 5c 69 74 65 6d 0a 43 |parison.|.\item.C|
|00003780| 6f 6e 73 74 72 75 63 74 | 6f 72 73 20 61 72 65 20 |onstruct|ors are |
|00003790| 6f 72 64 65 72 65 64 20 | 61 63 63 6f 72 64 69 6e |ordered |accordin|
|000037a0| 67 20 74 6f 20 74 68 65 | 69 72 20 6f 72 64 65 72 |g to the|ir order|
|000037b0| 20 6f 66 20 64 65 66 69 | 6e 69 74 69 6f 6e 20 69 | of defi|nition i|
|000037c0| 6e 20 74 68 65 0a 64 61 | 74 61 73 74 72 75 63 74 |n the.da|tastruct|
|000037d0| 75 72 65 20 66 69 6c 65 | 2c 0a 77 68 65 72 65 20 |ure file|,.where |
|000037e0| 74 68 65 20 66 69 72 73 | 74 20 63 6f 6e 73 74 72 |the firs|t constr|
|000037f0| 75 63 74 6f 72 20 69 73 | 20 74 68 65 20 73 6d 61 |uctor is| the sma|
|00003800| 6c 6c 65 73 74 2e 0a 43 | 6f 6e 73 74 72 75 63 74 |llest..C|onstruct|
|00003810| 6f 72 73 20 61 72 65 20 | 65 71 75 61 6c 20 69 66 |ors are |equal if|
|00003820| 20 61 6c 6c 20 74 68 65 | 69 72 20 65 6c 65 6d 65 | all the|ir eleme|
|00003830| 6e 74 73 20 61 72 65 20 | 65 71 75 61 6c 2c 0a 65 |nts are |equal,.e|
|00003840| 6c 73 65 20 74 68 65 20 | 66 69 72 73 74 20 64 69 |lse the |first di|
|00003850| 66 66 65 72 69 6e 67 20 | 65 6c 65 6d 65 6e 74 20 |ffering |element |
|00003860| 66 72 6f 6d 20 74 68 65 | 20 6c 65 66 74 20 64 65 |from the| left de|
|00003870| 74 65 72 6d 69 6e 65 73 | 20 74 68 65 20 63 6f 6d |termines| the com|
|00003880| 70 61 72 69 73 6f 6e 2e | 0a 5c 69 74 65 6d 0a 4c |parison.|.\item.L|
|00003890| 69 73 74 73 20 61 72 65 | 20 65 71 75 61 6c 20 69 |ists are| equal i|
|000038a0| 66 20 61 6c 6c 20 74 68 | 65 69 72 20 65 6c 65 6d |f all th|eir elem|
|000038b0| 65 6e 74 73 20 61 72 65 | 20 65 71 75 61 6c 2c 0a |ents are| equal,.|
|000038c0| 65 6c 73 65 20 74 68 65 | 20 66 69 72 73 74 20 64 |else the| first d|
|000038d0| 69 66 66 65 72 69 6e 67 | 20 65 6c 65 6d 65 6e 74 |iffering| element|
|000038e0| 20 66 72 6f 6d 20 74 68 | 65 20 6c 65 66 74 20 64 | from th|e left d|
|000038f0| 65 74 65 72 6d 69 6e 65 | 73 20 74 68 65 20 63 6f |etermine|s the co|
|00003900| 6d 70 61 72 69 73 6f 6e | 2c 0a 6f 72 20 65 6c 73 |mparison|,.or els|
|00003910| 65 20 74 68 65 20 73 68 | 6f 72 74 65 73 74 20 6c |e the sh|ortest l|
|00003920| 69 73 74 20 69 73 20 74 | 68 65 20 73 6d 61 6c 6c |ist is t|he small|
|00003930| 65 73 74 2e 0a 5c 65 6e | 64 7b 69 74 65 6d 69 7a |est..\en|d{itemiz|
|00003940| 65 7d 0a 5c 70 61 72 0a | 54 68 65 73 65 20 66 75 |e}.\par.|These fu|
|00003950| 6e 63 74 69 6f 6e 73 20 | 61 72 65 20 6d 61 69 6e |nctions |are main|
|00003960| 6c 79 20 69 6e 74 65 6e | 64 65 64 20 66 6f 72 20 |ly inten|ded for |
|00003970| 65 71 75 61 6c 69 74 79 | 20 63 6f 6d 70 61 72 69 |equality| compari|
|00003980| 73 6f 6e 2c 0a 61 6e 64 | 20 74 6f 20 69 6d 70 6f |son,.and| to impo|
|00003990| 73 65 20 60 73 6f 6d 65 | 27 20 72 65 70 65 61 74 |se `some|' repeat|
|000039a0| 61 62 6c 65 20 6f 72 64 | 65 72 69 6e 67 20 6f 6e |able ord|ering on|
|000039b0| 20 74 68 65 20 64 61 74 | 61 73 74 72 75 63 74 75 | the dat|astructu|
|000039c0| 72 65 73 2e 0a 54 68 65 | 20 6f 72 64 65 72 69 6e |res..The| orderin|
|000039d0| 67 20 6d 61 79 20 62 65 | 20 64 69 66 66 65 72 65 |g may be| differe|
|000039e0| 6e 74 20 66 72 6f 6d 20 | 74 68 65 20 64 65 73 69 |nt from |the desi|
|000039f0| 72 65 64 20 6f 72 64 65 | 72 69 6e 67 2e 0a 49 66 |red orde|ring..If|
|00003a00| 20 61 6e 20 6f 74 68 65 | 72 20 63 6f 6d 70 61 72 | an othe|r compar|
|00003a10| 69 73 6f 6e 20 66 75 6e | 63 74 69 6f 6e 20 69 73 |ison fun|ction is|
|00003a20| 20 72 65 71 75 69 72 65 | 64 20 66 6f 72 20 6f 6e | require|d for on|
|00003a30| 65 20 64 61 74 61 74 79 | 70 65 2c 0a 74 68 65 20 |e dataty|pe,.the |
|00003a40| 67 65 6e 65 72 61 74 69 | 6f 6e 20 6f 66 20 74 68 |generati|on of th|
|00003a50| 65 20 73 74 61 6e 64 61 | 72 64 20 66 75 6e 63 74 |e standa|rd funct|
|00003a60| 69 6f 6e 20 63 61 6e 20 | 62 65 20 73 75 70 70 72 |ion can |be suppr|
|00003a70| 65 73 73 65 64 20 62 79 | 0a 75 73 69 6e 67 20 7b |essed by|.using {|
|00003a80| 5c 74 74 20 6e 6f 74 77 | 61 6e 74 64 65 66 73 7d |\tt notw|antdefs}|
|00003a90| 2c 20 73 65 65 20 73 65 | 63 74 69 6f 6e 20 5c 72 |, see se|ction \r|
|00003aa0| 65 66 7b 73 65 63 3a 63 | 6f 6e 66 69 67 7d 2e 0a |ef{sec:c|onfig}..|
|00003ab0| 5c 62 65 67 69 6e 7b 76 | 65 72 62 61 74 69 6d 7d |\begin{v|erbatim}|
|00003ac0| 0a 66 75 6e 63 74 69 6f | 6e 20 43 6d 70 3c 74 79 |.functio|n Cmp<ty|
|00003ad0| 70 65 3e 28 20 61 3a 20 | 3c 74 79 70 65 3e 3b 20 |pe>( a: |<type>; |
|00003ae0| 62 3a 20 3c 74 79 70 65 | 3e 20 29 3a 20 69 6e 74 |b: <type|> ): int|
|00003af0| 65 67 65 72 3b 0a 66 75 | 6e 63 74 69 6f 6e 20 43 |eger;.fu|nction C|
|00003b00| 6d 70 3c 74 79 70 65 3e | 6c 69 73 74 28 20 61 3a |mp<type>|list( a:|
|00003b10| 20 3c 74 79 70 65 3e 6c | 69 73 74 3b 20 62 3a 20 | <type>l|ist; b: |
|00003b20| 3c 74 79 70 65 3e 6c 69 | 73 74 20 29 3a 20 69 6e |<type>li|st ): in|
|00003b30| 74 65 67 65 72 3b 0a 5c | 65 6e 64 7b 76 65 72 62 |teger;.\|end{verb|
|00003b40| 61 74 69 6d 7d 0a 5c 62 | 65 67 69 6e 7b 64 65 73 |atim}.\b|egin{des|
|00003b50| 63 7d 0a 43 6f 6d 70 61 | 72 65 20 64 61 74 61 73 |c}.Compa|re datas|
|00003b60| 74 72 75 63 74 75 72 65 | 73 20 7b 5c 74 74 20 61 |tructure|s {\tt a|
|00003b70| 7d 20 61 6e 64 20 7b 5c | 74 74 20 62 7d 2c 20 61 |} and {\|tt b}, a|
|00003b80| 6e 64 20 72 65 74 75 72 | 6e 20 61 20 63 6f 64 65 |nd retur|n a code|
|00003b90| 0a 61 63 63 6f 72 64 69 | 6e 67 20 74 6f 20 74 68 |.accordi|ng to th|
|00003ba0| 65 20 74 61 62 6c 65 20 | 6c 69 73 74 65 64 20 70 |e table |listed p|
|00003bb0| 72 65 76 69 6f 75 73 6c | 79 2e 0a 5c 65 6e 64 7b |reviousl|y..\end{|
|00003bc0| 64 65 73 63 7d 0a 5c 73 | 65 63 74 69 6f 6e 7b 50 |desc}.\s|ection{P|
|00003bd0| 61 73 63 61 6c 20 63 6f | 64 65 20 6c 69 62 72 61 |ascal co|de libra|
|00003be0| 72 79 7d 0a 5c 6c 61 62 | 65 6c 7b 73 65 63 3a 6c |ry}.\lab|el{sec:l|
|00003bf0| 69 62 7d 0a 54 68 65 20 | 7b 5c 70 61 73 63 61 6c |ib}.The |{\pascal|
|00003c00| 7d 20 63 6f 64 65 20 6c | 69 62 72 61 72 79 20 70 |} code l|ibrary p|
|00003c10| 72 6f 76 69 64 65 73 20 | 64 65 66 69 6e 69 74 69 |rovides |definiti|
|00003c20| 6f 6e 73 20 69 6e 0a 74 | 68 65 20 73 61 6d 65 20 |ons in.t|he same |
|00003c30| 63 6c 61 73 73 20 61 73 | 20 74 68 65 20 67 65 6e |class as| the gen|
|00003c40| 65 72 61 74 65 64 20 64 | 65 66 69 6e 69 74 69 6f |erated d|efinitio|
|00003c50| 6e 73 20 66 6f 72 20 61 | 20 6e 75 6d 62 65 72 20 |ns for a| number |
|00003c60| 6f 66 20 63 6f 6d 6d 6f | 6e 6c 79 20 75 73 65 64 |of commo|nly used|
|00003c70| 0a 70 72 69 6d 69 74 69 | 76 65 20 74 79 70 65 73 |.primiti|ve types|
|00003c80| 2e 0a 49 74 20 61 6c 73 | 6f 20 63 6f 6e 74 61 69 |..It als|o contai|
|00003c90| 6e 73 20 6c 6f 77 2d 6c | 65 76 65 6c 20 64 65 66 |ns low-l|evel def|
|00003ca0| 69 6e 69 74 69 6f 6e 73 | 20 74 68 61 74 20 61 72 |initions| that ar|
|00003cb0| 65 20 72 65 71 75 69 72 | 65 64 20 62 79 20 74 68 |e requir|ed by th|
|00003cc0| 65 20 67 65 6e 65 72 61 | 74 65 64 0a 64 65 66 69 |e genera|ted.defi|
|00003cd0| 6e 69 74 69 6f 6e 73 2e | 0a 5c 62 65 67 69 6e 7b |nitions.|.\begin{|
|00003ce0| 76 65 72 62 61 74 69 6d | 7d 0a 70 72 6f 63 65 64 |verbatim|}.proced|
|00003cf0| 75 72 65 20 74 6d 67 65 | 74 63 28 20 76 61 72 20 |ure tmge|tc( var |
|00003d00| 66 3a 20 74 65 78 74 20 | 29 3b 0a 5c 65 6e 64 7b |f: text |);.\end{|
|00003d10| 76 65 72 62 61 74 69 6d | 7d 0a 5c 62 65 67 69 6e |verbatim|}.\begin|
|00003d20| 7b 64 65 73 63 7d 0a 52 | 65 61 64 20 61 20 63 68 |{desc}.R|ead a ch|
|00003d30| 61 72 61 63 74 65 72 20 | 66 72 6f 6d 20 66 69 6c |aracter |from fil|
|00003d40| 65 20 7b 5c 74 74 20 66 | 7d 20 69 6e 20 74 68 65 |e {\tt f|} in the|
|00003d50| 20 67 6c 6f 62 61 6c 20 | 76 61 72 69 61 62 6c 65 | global |variable|
|00003d60| 20 7b 5c 74 74 20 74 6d | 63 75 72 63 68 61 72 7d | {\tt tm|curchar}|
|00003d70| 2e 0a 54 68 65 20 65 6f | 6c 6e 20 63 6f 6e 64 69 |..The eo|ln condi|
|00003d80| 74 69 6f 6e 20 69 73 20 | 63 6f 6e 76 65 72 74 65 |tion is |converte|
|00003d90| 64 20 74 6f 20 61 20 73 | 70 65 63 69 61 6c 0a 7b |d to a s|pecial.{|
|00003da0| 5c 74 74 20 74 6d 65 6f | 6c 6e 63 68 61 72 7d 20 |\tt tmeo|lnchar} |
|00003db0| 63 68 61 72 61 63 74 65 | 72 2e 0a 44 75 72 69 6e |characte|r..Durin|
|00003dc0| 67 20 65 6f 66 20 7b 5c | 74 74 20 74 6d 65 6f 66 |g eof {\|tt tmeof|
|00003dd0| 63 68 61 72 7d 20 69 73 | 20 70 75 74 20 69 6e 74 |char} is| put int|
|00003de0| 6f 20 7b 5c 74 74 20 74 | 6d 63 75 72 63 68 61 72 |o {\tt t|mcurchar|
|00003df0| 7d 2e 0a 5c 65 6e 64 7b | 64 65 73 63 7d 0a 5c 62 |}..\end{|desc}.\b|
|00003e00| 65 67 69 6e 7b 76 65 72 | 62 61 74 69 6d 7d 0a 70 |egin{ver|batim}.p|
|00003e10| 72 6f 63 65 64 75 72 65 | 20 74 6d 72 65 61 64 73 |rocedure| tmreads|
|00003e20| 70 63 28 20 76 61 72 20 | 66 3a 20 74 65 78 74 20 |pc( var |f: text |
|00003e30| 29 3b 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |);.\end{|verbatim|
|00003e40| 7d 0a 5c 62 65 67 69 6e | 7b 64 65 73 63 7d 0a 53 |}.\begin|{desc}.S|
|00003e50| 6b 69 70 20 61 6c 6c 20 | 73 70 61 63 65 73 2c 20 |kip all |spaces, |
|00003e60| 74 61 62 73 2c 20 66 6f | 72 6d 20 66 65 65 64 73 |tabs, fo|rm feeds|
|00003e70| 20 61 6e 64 20 63 6f 6d | 6d 65 6e 74 20 69 6e 20 | and com|ment in |
|00003e80| 74 68 65 20 69 6e 70 75 | 74 20 75 70 20 74 6f 20 |the inpu|t up to |
|00003e90| 74 68 65 0a 6e 65 78 74 | 20 6e 6f 6e 2d 77 68 69 |the.next| non-whi|
|00003ea0| 74 65 20 63 68 61 72 61 | 63 74 65 72 2e 0a 41 20 |te chara|cter..A |
|00003eb0| 63 6f 6d 6d 65 6e 74 20 | 69 73 20 73 74 61 72 74 |comment |is start|
|00003ec0| 65 64 20 77 69 74 68 20 | 61 20 7b 5c 65 6d 20 73 |ed with |a {\em s|
|00003ed0| 69 6e 67 6c 65 7d 20 7b | 5c 74 74 20 7c 7d 20 61 |ingle} {|\tt |} a|
|00003ee0| 6e 64 20 69 73 20 74 65 | 72 6d 69 6e 61 74 65 64 |nd is te|rminated|
|00003ef0| 20 62 79 20 61 20 6e 65 | 77 6c 69 6e 65 2e 0a 54 | by a ne|wline..T|
|00003f00| 6f 20 72 65 6d 61 69 6e | 20 63 6f 6d 70 61 74 69 |o remain| compati|
|00003f10| 62 6c 65 20 77 69 74 68 | 20 74 68 65 20 4d 69 72 |ble with| the Mir|
|00003f20| 61 6e 64 61 20 70 61 72 | 73 65 72 2c 0a 61 20 66 |anda par|ser,.a f|
|00003f30| 69 6c 65 20 73 68 6f 75 | 6c 64 20 61 6c 77 61 79 |ile shou|ld alway|
|00003f40| 73 20 75 73 65 20 7b 5c | 74 74 20 7c 7c 7d 20 61 |s use {\|tt ||} a|
|00003f50| 73 20 63 6f 6d 6d 65 6e | 74 20 73 74 61 72 74 2c |s commen|t start,|
|00003f60| 0a 62 75 74 20 74 6f 20 | 63 68 65 63 6b 20 74 68 |.but to |check th|
|00003f70| 69 73 20 63 61 75 73 65 | 73 20 70 72 6f 62 6c 65 |is cause|s proble|
|00003f80| 6d 73 20 69 6e 20 70 61 | 72 73 69 6e 67 2e 0a 5c |ms in pa|rsing..\|
|00003f90| 65 6e 64 7b 64 65 73 63 | 7d 0a 5c 62 65 67 69 6e |end{desc|}.\begin|
|00003fa0| 7b 76 65 72 62 61 74 69 | 6d 7d 0a 66 75 6e 63 74 |{verbati|m}.funct|
|00003fb0| 69 6f 6e 20 74 6d 6e 65 | 65 64 63 28 20 76 61 72 |ion tmne|edc( var|
|00003fc0| 20 66 2c 20 72 66 3a 20 | 74 65 78 74 3b 20 63 3a | f, rf: |text; c:|
|00003fd0| 20 63 68 61 72 20 29 3a | 20 62 6f 6f 6c 65 61 6e | char ):| boolean|
|00003fe0| 3b 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |;.\end{v|erbatim}|
|00003ff0| 0a 5c 62 65 67 69 6e 7b | 64 65 73 63 7d 0a 41 66 |.\begin{|desc}.Af|
|00004000| 74 65 72 20 73 6b 69 70 | 70 69 6e 67 20 73 70 61 |ter skip|ping spa|
|00004010| 63 65 73 2c 20 74 61 62 | 73 2c 20 66 6f 72 6d 20 |ces, tab|s, form |
|00004020| 66 65 65 64 73 20 61 6e | 64 20 63 6f 6d 6d 65 6e |feeds an|d commen|
|00004030| 74 2c 0a 74 72 79 20 74 | 6f 20 72 65 61 64 20 63 |t,.try t|o read c|
|00004040| 68 61 72 61 63 74 65 72 | 20 7b 5c 74 74 20 63 7d |haracter| {\tt c}|
|00004050| 20 66 72 6f 6d 20 66 69 | 6c 65 20 7b 5c 74 74 20 | from fi|le {\tt |
|00004060| 66 7d 2e 0a 52 65 74 75 | 72 6e 20 61 20 76 61 6c |f}..Retu|rn a val|
|00004070| 75 65 20 7b 5c 74 74 20 | 74 72 75 65 7d 20 61 6e |ue {\tt |true} an|
|00004080| 64 20 77 72 69 74 65 20 | 61 6e 20 65 72 72 6f 72 |d write |an error|
|00004090| 20 6d 65 73 73 61 67 65 | 20 74 6f 20 7b 5c 74 74 | message| to {\tt|
|000040a0| 20 72 66 7d 20 69 66 20 | 74 68 69 73 0a 69 73 20 | rf} if |this.is |
|000040b0| 6e 6f 74 20 70 6f 73 73 | 69 62 6c 65 2c 0a 65 6c |not poss|ible,.el|
|000040c0| 73 65 20 72 65 74 75 72 | 6e 20 7b 5c 74 74 20 66 |se retur|n {\tt f|
|000040d0| 61 6c 73 65 7d 2e 0a 5c | 65 6e 64 7b 64 65 73 63 |alse}..\|end{desc|
|000040e0| 7d 0a 5c 62 65 67 69 6e | 7b 76 65 72 62 61 74 69 |}.\begin|{verbati|
|000040f0| 6d 7d 0a 66 75 6e 63 74 | 69 6f 6e 20 74 6d 72 65 |m}.funct|ion tmre|
|00004100| 61 64 63 28 20 76 61 72 | 20 66 2c 20 72 66 3a 20 |adc( var| f, rf: |
|00004110| 74 65 78 74 3b 20 76 61 | 72 20 63 3a 20 63 68 61 |text; va|r c: cha|
|00004120| 72 20 29 3a 20 62 6f 6f | 6c 65 61 6e 3b 0a 5c 65 |r ): boo|lean;.\e|
|00004130| 6e 64 7b 76 65 72 62 61 | 74 69 6d 7d 0a 5c 62 65 |nd{verba|tim}.\be|
|00004140| 67 69 6e 7b 64 65 73 63 | 7d 0a 52 65 61 64 20 61 |gin{desc|}.Read a|
|00004150| 20 63 68 61 72 20 66 72 | 6f 6d 20 66 69 6c 65 20 | char fr|om file |
|00004160| 7b 5c 74 74 20 66 7d 20 | 69 6e 74 6f 20 7b 5c 74 |{\tt f} |into {\t|
|00004170| 74 20 63 7d 2e 0a 50 72 | 65 63 65 64 69 6e 67 20 |t c}..Pr|eceding |
|00004180| 62 6c 61 6e 6b 73 20 61 | 6e 64 20 63 6f 6d 6d 65 |blanks a|nd comme|
|00004190| 6e 74 20 61 72 65 20 7b | 5c 65 6d 20 6e 6f 74 7d |nt are {|\em not}|
|000041a0| 20 73 6b 69 70 70 65 64 | 2e 0a 42 61 63 6b 73 6c | skipped|..Backsl|
|000041b0| 61 73 68 20 65 73 63 61 | 70 65 20 73 65 71 75 65 |ash esca|pe seque|
|000041c0| 6e 63 65 73 20 61 72 65 | 20 72 65 63 6f 67 6e 69 |nces are| recogni|
|000041d0| 7a 65 64 2e 0a 54 68 69 | 73 20 66 75 6e 63 74 69 |zed..Thi|s functi|
|000041e0| 6f 6e 20 69 73 20 75 73 | 65 64 20 62 79 20 7b 5c |on is us|ed by {\|
|000041f0| 74 74 20 52 65 61 64 63 | 68 61 72 7d 2c 0a 61 6e |tt Readc|har},.an|
|00004200| 64 20 73 68 6f 75 6c 64 | 20 62 65 20 75 73 65 64 |d should| be used|
|00004210| 20 62 79 20 7b 5c 74 74 | 20 52 65 61 64 73 74 72 | by {\tt| Readstr|
|00004220| 69 6e 67 7d 20 69 66 20 | 69 74 20 69 73 20 69 6d |ing} if |it is im|
|00004230| 70 6c 65 6d 65 6e 74 65 | 64 2e 0a 5c 65 6e 64 7b |plemente|d..\end{|
|00004240| 64 65 73 63 7d 0a 5c 62 | 65 67 69 6e 7b 76 65 72 |desc}.\b|egin{ver|
|00004250| 62 61 74 69 6d 7d 0a 70 | 72 6f 63 65 64 75 72 65 |batim}.p|rocedure|
|00004260| 20 74 6d 72 65 61 64 6f | 62 72 61 63 28 20 76 61 | tmreado|brac( va|
|00004270| 72 20 66 3a 20 74 65 78 | 74 3b 20 76 61 72 20 6e |r f: tex|t; var n|
|00004280| 3a 20 69 6e 74 65 67 65 | 72 20 29 3b 0a 66 75 6e |: intege|r );.fun|
|00004290| 63 74 69 6f 6e 20 74 6d | 72 65 61 64 63 62 72 61 |ction tm|readcbra|
|000042a0| 63 28 20 76 61 72 20 66 | 2c 20 72 66 3a 20 74 65 |c( var f|, rf: te|
|000042b0| 78 74 3b 20 6e 3a 20 69 | 6e 74 65 67 65 72 20 29 |xt; n: i|nteger )|
|000042c0| 3a 20 62 6f 6f 6c 65 61 | 6e 3b 0a 5c 65 6e 64 7b |: boolea|n;.\end{|
|000042d0| 76 65 72 62 61 74 69 6d | 7d 0a 5c 62 65 67 69 6e |verbatim|}.\begin|
|000042e0| 7b 64 65 73 63 7d 0a 48 | 61 6e 64 6c 65 20 62 72 |{desc}.H|andle br|
|000042f0| 61 63 6b 65 74 73 20 61 | 72 6f 75 6e 64 20 63 6f |ackets a|round co|
|00004300| 6e 73 74 72 75 63 74 6f | 72 73 2e 0a 7b 5c 74 74 |nstructo|rs..{\tt|
|00004310| 20 74 6d 72 65 61 64 6f | 62 72 61 63 28 29 7d 20 | tmreado|brac()} |
|00004320| 63 6f 75 6e 74 73 20 61 | 6e 64 20 73 65 74 73 20 |counts a|nd sets |
|00004330| 70 61 72 61 6d 65 74 65 | 72 20 7b 5c 74 74 20 6e |paramete|r {\tt n|
|00004340| 7d 20 74 6f 20 74 68 65 | 20 6e 75 6d 62 65 72 0a |} to the| number.|
|00004350| 6f 66 20 6f 70 65 6e 20 | 62 72 61 63 6b 65 74 73 |of open |brackets|
|00004360| 20 28 60 7b 5c 74 74 20 | 28 7d 27 29 20 69 74 20 | (`{\tt |(}') it |
|00004370| 65 6e 63 6f 75 6e 74 65 | 72 73 20 75 70 20 74 6f |encounte|rs up to|
|00004380| 20 74 68 65 20 66 69 72 | 73 74 20 63 68 61 72 61 | the fir|st chara|
|00004390| 63 74 65 72 0a 74 68 61 | 74 20 69 73 20 6e 6f 74 |cter.tha|t is not|
|000043a0| 20 77 68 69 74 65 20 73 | 70 61 63 65 2c 20 63 6f | white s|pace, co|
|000043b0| 6d 6d 65 6e 74 20 20 6f | 72 20 61 6e 20 6f 70 65 |mment o|r an ope|
|000043c0| 6e 20 62 72 61 63 6b 65 | 74 2e 0a 7b 5c 74 74 20 |n bracke|t..{\tt |
|000043d0| 74 6d 72 65 61 64 63 62 | 72 61 63 28 29 7d 20 74 |tmreadcb|rac()} t|
|000043e0| 72 69 65 73 20 74 6f 20 | 72 65 61 64 20 7b 5c 74 |ries to |read {\t|
|000043f0| 74 20 6e 7d 20 63 6c 6f | 73 65 20 62 72 61 63 6b |t n} clo|se brack|
|00004400| 65 74 73 20 28 60 7b 5c | 74 74 20 29 7d 27 29 2c |ets (`{\|tt )}'),|
|00004410| 0a 61 6e 64 20 77 69 6c | 6c 20 72 65 74 75 72 6e |.and wil|l return|
|00004420| 20 7b 5c 74 74 20 74 72 | 75 65 7d 20 61 6e 64 20 | {\tt tr|ue} and |
|00004430| 77 72 69 74 65 20 61 6e | 20 65 72 72 6f 72 20 6d |write an| error m|
|00004440| 65 73 73 61 67 65 20 74 | 6f 20 7b 5c 74 74 20 72 |essage t|o {\tt r|
|00004450| 66 7d 20 69 66 20 74 68 | 69 73 0a 69 73 20 6e 6f |f} if th|is.is no|
|00004460| 74 20 70 6f 73 73 69 62 | 6c 65 2c 0a 6f 72 20 77 |t possib|le,.or w|
|00004470| 69 6c 6c 20 72 65 74 75 | 72 6e 20 7b 5c 74 74 20 |ill retu|rn {\tt |
|00004480| 66 61 6c 73 65 7d 20 69 | 66 20 69 74 20 69 73 20 |false} i|f it is |
|00004490| 73 75 63 63 65 73 73 66 | 75 6c 2e 0a 5c 65 6e 64 |successf|ul..\end|
|000044a0| 7b 64 65 73 63 7d 0a 5c | 62 65 67 69 6e 7b 76 65 |{desc}.\|begin{ve|
|000044b0| 72 62 61 74 69 6d 7d 0a | 70 72 6f 63 65 64 75 72 |rbatim}.|procedur|
|000044c0| 65 20 74 6d 77 72 69 74 | 65 63 28 20 76 61 72 20 |e tmwrit|ec( var |
|000044d0| 66 3a 20 74 65 78 74 3b | 20 63 3a 20 63 68 61 72 |f: text;| c: char|
|000044e0| 20 29 3b 0a 5c 65 6e 64 | 7b 76 65 72 62 61 74 69 | );.\end|{verbati|
|000044f0| 6d 7d 0a 5c 62 65 67 69 | 6e 7b 64 65 73 63 7d 0a |m}.\begi|n{desc}.|
|00004500| 57 72 69 74 65 20 61 20 | 63 68 61 72 20 7b 5c 74 |Write a |char {\t|
|00004510| 74 20 63 7d 20 74 6f 20 | 66 69 6c 65 20 7b 5c 74 |t c} to |file {\t|
|00004520| 74 20 66 7d 2e 0a 42 61 | 63 6b 73 6c 61 73 68 20 |t f}..Ba|ckslash |
|00004530| 65 73 63 61 70 65 20 73 | 65 71 75 65 6e 63 65 73 |escape s|equences|
|00004540| 20 61 72 65 20 75 73 65 | 64 20 77 68 65 6e 20 6e | are use|d when n|
|00004550| 65 63 65 73 73 61 72 79 | 2e 0a 54 68 69 73 20 66 |ecessary|..This f|
|00004560| 75 6e 63 74 69 6f 6e 20 | 69 73 20 75 73 65 64 20 |unction |is used |
|00004570| 62 79 20 7b 5c 74 74 20 | 57 72 69 74 65 63 68 61 |by {\tt |Writecha|
|00004580| 72 7d 2c 0a 61 6e 64 20 | 73 68 6f 75 6c 64 20 62 |r},.and |should b|
|00004590| 65 20 75 73 65 64 20 62 | 79 20 7b 5c 74 74 20 57 |e used b|y {\tt W|
|000045a0| 72 69 74 65 73 74 72 69 | 6e 67 7d 20 69 66 20 69 |ritestri|ng} if i|
|000045b0| 74 20 69 73 20 69 6d 70 | 6c 65 6d 65 6e 74 65 64 |t is imp|lemented|
|000045c0| 2e 0a 5c 65 6e 64 7b 64 | 65 73 63 7d 0a 5c 62 65 |..\end{d|esc}.\be|
|000045d0| 67 69 6e 7b 76 65 72 62 | 61 74 69 6d 7d 0a 66 75 |gin{verb|atim}.fu|
|000045e0| 6e 63 74 69 6f 6e 20 52 | 65 61 64 72 65 61 6c 28 |nction R|eadreal(|
|000045f0| 20 76 61 72 20 66 2c 20 | 72 66 3a 20 74 65 78 74 | var f, |rf: text|
|00004600| 3b 20 76 61 72 20 72 3a | 20 72 65 61 6c 20 29 3a |; var r:| real ):|
|00004610| 20 62 6f 6f 6c 65 61 6e | 3b 0a 70 72 6f 63 65 64 | boolean|;.proced|
|00004620| 75 72 65 20 57 72 69 74 | 65 72 65 61 6c 28 20 76 |ure Writ|ereal( v|
|00004630| 61 72 20 66 3a 20 74 65 | 78 74 3b 20 72 3a 20 72 |ar f: te|xt; r: r|
|00004640| 65 61 6c 20 29 3b 0a 70 | 72 6f 63 65 64 75 72 65 |eal );.p|rocedure|
|00004650| 20 52 66 72 65 72 65 61 | 6c 28 20 72 3a 20 72 65 | Rfrerea|l( r: re|
|00004660| 61 6c 20 29 3b 0a 66 75 | 6e 63 74 69 6f 6e 20 43 |al );.fu|nction C|
|00004670| 6d 70 72 65 61 6c 28 20 | 61 2c 20 62 3a 20 72 65 |mpreal( |a, b: re|
|00004680| 61 6c 20 29 3a 20 69 6e | 74 65 67 65 72 3b 0a 5c |al ): in|teger;.\|
|00004690| 65 6e 64 7b 76 65 72 62 | 61 74 69 6d 7d 0a 5c 62 |end{verb|atim}.\b|
|000046a0| 65 67 69 6e 7b 64 65 73 | 63 7d 0a 4d 6f 64 75 6c |egin{des|c}.Modul|
|000046b0| 65 20 66 75 6e 63 74 69 | 6f 6e 73 20 66 6f 72 20 |e functi|ons for |
|000046c0| 74 79 70 65 20 60 72 65 | 61 6c 27 2e 0a 5c 65 6e |type `re|al'..\en|
|000046d0| 64 7b 64 65 73 63 7d 0a | 5c 62 65 67 69 6e 7b 76 |d{desc}.|\begin{v|
|000046e0| 65 72 62 61 74 69 6d 7d | 0a 69 6e 74 20 52 65 61 |erbatim}|.int Rea|
|000046f0| 64 69 6e 74 65 67 65 72 | 28 20 76 61 72 20 66 2c |dinteger|( var f,|
|00004700| 20 72 66 3a 20 74 65 78 | 74 3b 20 76 61 72 20 69 | rf: tex|t; var i|
|00004710| 3a 20 69 6e 74 65 67 65 | 72 20 29 3a 20 62 6f 6f |: intege|r ): boo|
|00004720| 6c 65 61 6e 3b 0a 70 72 | 6f 63 65 64 75 72 65 20 |lean;.pr|ocedure |
|00004730| 57 72 69 74 65 69 6e 74 | 65 67 65 72 28 20 76 61 |Writeint|eger( va|
|00004740| 72 20 66 3a 20 74 65 78 | 74 3b 20 69 3a 20 69 6e |r f: tex|t; i: in|
|00004750| 74 65 67 65 72 20 29 3b | 0a 70 72 6f 63 65 64 75 |teger );|.procedu|
|00004760| 72 65 20 52 66 72 65 69 | 6e 74 65 67 65 72 28 20 |re Rfrei|nteger( |
|00004770| 72 3a 20 69 6e 74 65 67 | 65 72 20 29 3b 0a 66 75 |r: integ|er );.fu|
|00004780| 6e 63 74 69 6f 6e 20 43 | 6d 70 69 6e 74 65 67 65 |nction C|mpintege|
|00004790| 72 28 20 61 2c 20 62 3a | 20 69 6e 74 65 67 65 72 |r( a, b:| integer|
|000047a0| 20 29 3a 20 69 6e 74 65 | 67 65 72 3b 0a 5c 65 6e | ): inte|ger;.\en|
|000047b0| 64 7b 76 65 72 62 61 74 | 69 6d 7d 0a 5c 62 65 67 |d{verbat|im}.\beg|
|000047c0| 69 6e 7b 64 65 73 63 7d | 0a 4d 6f 64 75 6c 65 20 |in{desc}|.Module |
|000047d0| 66 75 6e 63 74 69 6f 6e | 73 20 66 6f 72 20 74 79 |function|s for ty|
|000047e0| 70 65 20 60 69 6e 74 65 | 67 65 72 27 2e 0a 5c 65 |pe `inte|ger'..\e|
|000047f0| 6e 64 7b 64 65 73 63 7d | 0a 5c 62 65 67 69 6e 7b |nd{desc}|.\begin{|
|00004800| 76 65 72 62 61 74 69 6d | 7d 0a 66 75 6e 63 74 69 |verbatim|}.functi|
|00004810| 6f 6e 20 52 65 61 64 62 | 6f 6f 6c 65 61 6e 28 20 |on Readb|oolean( |
|00004820| 76 61 72 20 66 2c 20 72 | 66 3a 20 74 65 78 74 3b |var f, r|f: text;|
|00004830| 20 76 61 72 20 62 3a 20 | 62 6f 6f 6c 65 61 6e 20 | var b: |boolean |
|00004840| 29 3a 20 62 6f 6f 6c 65 | 61 6e 3b 0a 70 72 6f 63 |): boole|an;.proc|
|00004850| 65 64 75 72 65 20 57 72 | 69 74 65 62 6f 6f 6c 65 |edure Wr|iteboole|
|00004860| 61 6e 28 20 76 61 72 20 | 66 3a 20 74 65 78 74 3b |an( var |f: text;|
|00004870| 20 62 3a 20 62 6f 6f 6c | 65 61 6e 20 29 3b 0a 70 | b: bool|ean );.p|
|00004880| 72 6f 63 65 64 75 72 65 | 20 52 66 72 65 62 6f 6f |rocedure| Rfreboo|
|00004890| 6c 65 61 6e 28 20 62 3a | 20 62 6f 6f 6c 65 61 6e |lean( b:| boolean|
|000048a0| 20 29 3b 0a 66 75 6e 63 | 74 69 6f 6e 20 43 6d 70 | );.func|tion Cmp|
|000048b0| 62 6f 6f 6c 65 61 6e 28 | 20 61 2c 20 62 3a 20 62 |boolean(| a, b: b|
|000048c0| 6f 6f 6c 65 61 6e 20 29 | 3a 20 69 6e 74 65 67 65 |oolean )|: intege|
|000048d0| 72 3b 0a 5c 65 6e 64 7b | 76 65 72 62 61 74 69 6d |r;.\end{|verbatim|
|000048e0| 7d 0a 5c 62 65 67 69 6e | 7b 64 65 73 63 7d 0a 4d |}.\begin|{desc}.M|
|000048f0| 6f 64 75 6c 65 20 66 75 | 6e 63 74 69 6f 6e 73 20 |odule fu|nctions |
|00004900| 66 6f 72 20 74 79 70 65 | 20 60 62 6f 6f 6c 65 61 |for type| `boolea|
|00004910| 6e 27 2e 0a 5c 65 6e 64 | 7b 64 65 73 63 7d 0a 5c |n'..\end|{desc}.\|
|00004920| 62 65 67 69 6e 7b 76 65 | 72 62 61 74 69 6d 7d 0a |begin{ve|rbatim}.|
|00004930| 66 75 6e 63 74 69 6f 6e | 20 52 65 61 64 63 68 61 |function| Readcha|
|00004940| 72 28 20 76 61 72 20 66 | 2c 20 72 66 3a 20 74 65 |r( var f|, rf: te|
|00004950| 78 74 3b 20 76 61 72 20 | 63 3a 20 63 68 61 72 20 |xt; var |c: char |
|00004960| 29 3a 20 62 6f 6f 6c 65 | 61 6e 3b 0a 70 72 6f 63 |): boole|an;.proc|
|00004970| 65 64 75 72 65 20 57 72 | 69 74 65 63 68 61 72 28 |edure Wr|itechar(|
|00004980| 20 76 61 72 20 66 3a 20 | 74 65 78 74 3b 20 63 3a | var f: |text; c:|
|00004990| 20 63 68 61 72 20 29 3b | 0a 70 72 6f 63 65 64 75 | char );|.procedu|
|000049a0| 72 65 20 52 66 72 65 63 | 68 61 72 28 20 63 3a 20 |re Rfrec|har( c: |
|000049b0| 63 68 61 72 20 29 3b 0a | 66 75 6e 63 74 69 6f 6e |char );.|function|
|000049c0| 20 43 6d 70 63 68 61 72 | 28 20 61 2c 20 62 3a 20 | Cmpchar|( a, b: |
|000049d0| 63 68 61 72 20 29 3a 20 | 69 6e 74 65 67 65 72 3b |char ): |integer;|
|000049e0| 0a 5c 65 6e 64 7b 76 65 | 72 62 61 74 69 6d 7d 0a |.\end{ve|rbatim}.|
|000049f0| 5c 62 65 67 69 6e 7b 64 | 65 73 63 7d 0a 4d 6f 64 |\begin{d|esc}.Mod|
|00004a00| 75 6c 65 20 66 75 6e 63 | 74 69 6f 6e 73 20 66 6f |ule func|tions fo|
|00004a10| 72 20 74 79 70 65 20 60 | 63 68 61 72 27 2e 0a 5c |r type `|char'..\|
|00004a20| 65 6e 64 7b 64 65 73 63 | 7d 0a 5c 73 65 63 74 69 |end{desc|}.\secti|
|00004a30| 6f 6e 7b 7b 5c 74 6d 7d | 20 63 6f 6e 66 69 67 75 |on{{\tm}| configu|
|00004a40| 72 61 74 69 6f 6e 20 76 | 61 72 69 61 62 6c 65 73 |ration v|ariables|
|00004a50| 7d 0a 5c 6c 61 62 65 6c | 7b 73 65 63 3a 63 6f 6e |}.\label|{sec:con|
|00004a60| 66 69 67 7d 0a 54 68 65 | 20 74 65 6d 70 6c 61 74 |fig}.The| templat|
|00004a70| 65 73 20 75 73 65 20 61 | 20 66 65 77 20 7b 5c 74 |es use a| few {\t|
|00004a80| 6d 7d 20 76 61 72 69 61 | 62 6c 65 73 20 74 6f 20 |m} varia|bles to |
|00004a90| 6d 6f 64 69 66 79 20 74 | 68 65 20 63 6f 6e 74 65 |modify t|he conte|
|00004aa0| 6e 74 73 0a 6f 66 20 74 | 68 65 20 67 65 6e 65 72 |nts.of t|he gener|
|00004ab0| 61 74 65 64 20 63 6f 64 | 65 2e 0a 55 6e 6c 65 73 |ated cod|e..Unles|
|00004ac0| 73 20 73 74 61 74 65 64 | 20 6f 74 68 65 72 77 69 |s stated| otherwi|
|00004ad0| 73 65 2c 0a 69 74 20 69 | 73 20 6e 6f 74 20 6e 65 |se,.it i|s not ne|
|00004ae0| 63 65 73 73 61 72 79 20 | 74 6f 20 73 65 74 20 74 |cessary |to set t|
|00004af0| 68 65 6d 3b 0a 61 20 72 | 65 61 73 6f 6e 61 62 6c |hem;.a r|easonabl|
|00004b00| 65 20 64 65 66 61 75 6c | 74 20 77 69 6c 6c 20 62 |e defaul|t will b|
|00004b10| 65 20 63 68 6f 73 65 6e | 2e 0a 5c 70 61 72 0a 5c |e chosen|..\par.\|
|00004b20| 62 65 67 69 6e 7b 74 61 | 62 75 6c 61 72 2a 7d 7b |begin{ta|bular*}{|
|00004b30| 5c 74 65 78 74 77 69 64 | 74 68 7d 7b 6c 40 7b 5c |\textwid|th}{l@{\|
|00004b40| 65 78 74 72 61 63 6f 6c | 73 65 70 7b 5c 66 69 6c |extracol|sep{\fil|
|00004b50| 6c 7d 7d 70 7b 5c 64 65 | 73 63 77 69 64 74 68 7d |l}}p{\de|scwidth}|
|00004b60| 7d 0a 7b 5c 74 74 20 62 | 61 73 65 6e 61 6d 65 7d |}.{\tt b|asename}|
|00004b70| 0a 26 0a 54 68 69 73 20 | 76 61 72 69 61 62 6c 65 |.&.This |variable|
|00004b80| 20 69 73 20 75 73 65 64 | 20 74 6f 20 67 65 6e 65 | is used| to gene|
|00004b90| 72 61 74 65 20 74 68 65 | 20 6e 61 6d 65 73 20 6f |rate the| names o|
|00004ba0| 66 20 0a 64 65 66 69 6e | 69 74 69 6f 6e 73 20 74 |f .defin|itions t|
|00004bb0| 68 61 74 20 61 72 65 20 | 67 65 6e 65 72 61 74 65 |hat are |generate|
|00004bc0| 64 20 6f 6e 6c 79 20 6f | 6e 63 65 0a 28 65 2e 67 |d only o|nce.(e.g|
|00004bd0| 2e 20 69 6e 69 74 69 61 | 6c 69 7a 61 74 69 6f 6e |. initia|lization|
|00004be0| 20 61 6e 64 20 73 74 61 | 74 69 73 74 69 63 73 20 | and sta|tistics |
|00004bf0| 70 72 6f 63 65 64 75 72 | 65 73 29 2e 0a 54 68 69 |procedur|es)..Thi|
|00004c00| 73 20 76 61 72 69 61 62 | 6c 65 0a 7b 5c 65 6d 20 |s variab|le.{\em |
|00004c10| 6d 75 73 74 7d 0a 62 65 | 20 73 65 74 2e 0a 5c 5c |must}.be| set..\\|
|00004c20| 0a 7b 5c 74 74 20 77 61 | 6e 74 64 65 66 73 7d 0a |.{\tt wa|ntdefs}.|
|00004c30| 26 0a 49 66 20 73 65 74 | 2c 0a 74 68 69 73 20 76 |&.If set|,.this v|
|00004c40| 61 72 69 61 62 6c 65 20 | 63 6f 6e 74 61 69 6e 73 |ariable |contains|
|00004c50| 20 74 68 65 20 6e 61 6d | 65 73 20 6f 66 20 74 68 | the nam|es of th|
|00004c60| 65 20 74 79 70 65 20 61 | 6e 64 20 66 75 6e 63 74 |e type a|nd funct|
|00004c70| 69 6f 6e 20 64 65 66 69 | 6e 69 74 69 6f 6e 73 20 |ion defi|nitions |
|00004c80| 74 68 61 74 0a 6d 75 73 | 74 20 62 65 20 67 65 6e |that.mus|t be gen|
|00004c90| 65 72 61 74 65 64 2e 0a | 49 66 20 74 68 65 73 65 |erated..|If these|
|00004ca0| 20 66 75 6e 63 74 69 6f | 6e 73 20 72 65 71 75 69 | functio|ns requi|
|00004cb0| 72 65 20 74 68 65 20 64 | 65 66 69 6e 69 74 69 6f |re the d|efinitio|
|00004cc0| 6e 20 6f 66 20 6f 74 68 | 65 72 20 66 75 6e 63 74 |n of oth|er funct|
|00004cd0| 69 6f 6e 73 2c 0a 74 68 | 65 20 6e 65 63 65 73 73 |ions,.th|e necess|
|00004ce0| 61 72 79 20 66 75 6e 63 | 74 69 6f 6e 73 20 77 69 |ary func|tions wi|
|00004cf0| 6c 6c 20 62 65 20 67 65 | 6e 65 72 61 74 65 64 2c |ll be ge|nerated,|
|00004d00| 0a 62 75 74 20 77 69 6c | 6c 20 62 65 20 64 65 63 |.but wil|l be dec|
|00004d10| 6c 61 72 65 64 20 7b 5c | 74 74 20 73 74 61 74 69 |lared {\|tt stati|
|00004d20| 63 7d 2e 0a 49 66 20 7b | 5c 74 74 20 61 6c 6c 64 |c}..If {|\tt alld|
|00004d30| 65 66 73 7d 20 69 73 20 | 73 65 74 20 61 6c 6c 20 |efs} is |set all |
|00004d40| 70 6f 73 73 69 62 6c 65 | 20 64 65 66 69 6e 69 74 |possible| definit|
|00004d50| 69 6f 6e 73 20 61 72 65 | 20 67 65 6e 65 72 61 74 |ions are| generat|
|00004d60| 65 64 2e 0a 5c 70 61 72 | 0a 54 68 65 72 65 20 69 |ed..\par|.There i|
|00004d70| 73 20 6f 6e 65 20 65 78 | 63 65 70 74 69 6f 6e 3a |s one ex|ception:|
|00004d80| 0a 74 6f 20 72 65 71 75 | 65 73 74 20 74 68 65 20 |.to requ|est the |
|00004d90| 67 65 6e 65 72 61 74 69 | 6f 6e 20 6f 66 20 7b 5c |generati|on of {\|
|00004da0| 74 74 20 4e 65 77 3c 63 | 6f 6e 73 3e 7d 20 66 75 |tt New<c|ons>} fu|
|00004db0| 6e 63 74 69 6f 6e 73 20 | 66 6f 72 20 61 20 63 65 |nctions |for a ce|
|00004dc0| 72 74 61 69 6e 0a 63 6f | 6e 73 74 72 75 63 74 6f |rtain.co|nstructo|
|00004dd0| 72 20 74 79 70 65 20 7b | 5c 74 74 20 3c 74 79 70 |r type {|\tt <typ|
|00004de0| 65 3e 7d 2c 0a 7b 5c 74 | 74 20 4e 65 77 3c 74 79 |e>},.{\t|t New<ty|
|00004df0| 70 65 3e 7d 20 6d 75 73 | 74 20 62 65 20 61 64 64 |pe>} mus|t be add|
|00004e00| 65 64 20 74 6f 20 7b 5c | 74 74 20 77 61 6e 74 64 |ed to {\|tt wantd|
|00004e10| 65 66 73 7d 2e 0a 5c 5c | 0a 7b 5c 74 74 20 6e 6f |efs}..\\|.{\tt no|
|00004e20| 74 77 61 6e 74 64 65 66 | 73 7d 0a 26 0a 49 66 20 |twantdef|s}.&.If |
|00004e30| 73 65 74 2c 0a 74 68 69 | 73 20 76 61 72 69 61 62 |set,.thi|s variab|
|00004e40| 6c 65 20 63 6f 6e 74 61 | 69 6e 73 20 74 68 65 20 |le conta|ins the |
|00004e50| 6e 61 6d 65 73 20 6f 66 | 20 74 68 65 20 74 79 70 |names of| the typ|
|00004e60| 65 20 61 6e 64 20 66 75 | 6e 63 74 69 6f 6e 20 64 |e and fu|nction d|
|00004e70| 65 66 69 6e 69 74 69 6f | 6e 73 20 66 6f 72 0a 77 |efinitio|ns for.w|
|00004e80| 68 69 63 68 20 75 6e 64 | 65 72 20 61 6c 6c 20 63 |hich und|er all c|
|00004e90| 6f 6e 64 69 74 69 6f 6e | 73 20 7b 5c 74 74 20 6e |ondition|s {\tt n|
|00004ea0| 6f 7d 20 63 6f 64 65 20 | 6d 75 73 74 20 62 65 20 |o} code |must be |
|00004eb0| 67 65 6e 65 72 61 74 65 | 64 2e 0a 5c 5c 0a 7b 5c |generate|d..\\.{\|
|00004ec0| 74 74 20 61 6c 6c 64 65 | 66 73 7d 0a 26 0a 49 66 |tt allde|fs}.&.If|
|00004ed0| 20 73 65 74 2c 0a 74 68 | 69 73 20 76 61 72 69 61 | set,.th|is varia|
|00004ee0| 62 6c 65 20 69 6e 64 69 | 63 61 74 65 73 20 74 68 |ble indi|cates th|
|00004ef0| 61 74 20 61 6c 6c 20 70 | 6f 73 73 69 62 6c 65 20 |at all p|ossible |
|00004f00| 74 79 70 65 20 61 6e 64 | 20 66 75 6e 63 74 69 6f |type and| functio|
|00004f10| 6e 20 64 65 66 69 6e 69 | 74 69 6f 6e 73 20 6d 75 |n defini|tions mu|
|00004f20| 73 74 0a 62 65 20 67 65 | 6e 65 72 61 74 65 64 2e |st.be ge|nerated.|
|00004f30| 0a 5c 65 6e 64 7b 74 61 | 62 75 6c 61 72 2a 7d 0a |.\end{ta|bular*}.|
|00004f40| 5c 70 61 72 0a 41 74 20 | 6c 65 61 73 74 20 6f 6e |\par.At |least on|
|00004f50| 65 20 6f 66 20 74 68 65 | 20 76 61 72 69 61 62 6c |e of the| variabl|
|00004f60| 65 73 20 7b 5c 74 74 20 | 77 61 6e 74 64 65 66 73 |es {\tt |wantdefs|
|00004f70| 7d 20 61 6e 64 20 7b 5c | 74 74 20 61 6c 6c 64 65 |} and {\|tt allde|
|00004f80| 66 73 7d 20 6d 75 73 74 | 20 62 65 20 73 65 74 2e |fs} must| be set.|
|00004f90| 0a 5c 70 61 72 0a 54 68 | 65 20 74 68 65 20 76 61 |.\par.Th|e the va|
|00004fa0| 72 69 61 62 6c 65 20 7b | 5c 74 74 20 77 61 6e 74 |riable {|\tt want|
|00004fb0| 64 65 66 73 7d 20 73 68 | 6f 75 6c 64 20 63 6f 6e |defs} sh|ould con|
|00004fc0| 74 61 69 6e 20 74 68 65 | 20 6e 61 6d 65 73 20 6f |tain the| names o|
|00004fd0| 66 20 61 6c 6c 20 64 65 | 66 69 6e 69 74 69 6f 6e |f all de|finition|
|00004fe0| 73 0a 74 68 61 74 20 6d | 75 73 74 20 62 65 20 67 |s.that m|ust be g|
|00004ff0| 65 6e 65 72 61 74 65 64 | 2e 0a 54 68 65 73 65 20 |enerated|..These |
|00005000| 64 65 66 69 6e 69 74 69 | 6f 6e 73 20 6d 61 79 20 |definiti|ons may |
|00005010| 72 65 71 75 69 72 65 20 | 6f 74 68 65 72 20 64 65 |require |other de|
|00005020| 66 69 6e 69 74 69 6f 6e | 73 2c 0a 61 6e 64 20 66 |finition|s,.and f|
|00005030| 6f 72 20 66 6f 72 20 74 | 68 65 20 74 79 70 65 73 |or for t|he types|
|00005040| 20 64 65 66 69 6e 65 64 | 20 69 6e 20 74 68 65 20 | defined| in the |
|00005050| 64 61 74 61 73 74 72 75 | 63 74 75 72 65 20 66 69 |datastru|cture fi|
|00005060| 6c 65 0a 74 68 65 73 65 | 20 72 65 71 75 69 72 65 |le.these| require|
|00005070| 6d 65 6e 74 73 20 77 69 | 6c 6c 20 62 65 20 64 65 |ments wi|ll be de|
|00005080| 64 75 63 65 64 2c 0a 61 | 6e 64 20 74 68 65 20 6e |duced,.a|nd the n|
|00005090| 65 63 65 73 73 61 72 79 | 20 63 6f 64 65 20 77 69 |ecessary| code wi|
|000050a0| 6c 6c 20 62 65 20 67 65 | 6e 65 72 61 74 65 64 2e |ll be ge|nerated.|
|000050b0| 0a 48 6f 77 65 76 65 72 | 2c 0a 74 68 65 20 6e 65 |.However|,.the ne|
|000050c0| 65 64 20 66 6f 72 20 73 | 75 70 70 6f 72 74 20 66 |ed for s|upport f|
|000050d0| 75 6e 63 74 69 6f 6e 73 | 20 28 65 2e 67 2e 20 7b |unctions| (e.g. {|
|000050e0| 5c 74 74 20 74 6d 67 65 | 74 63 7d 29 20 61 6e 64 |\tt tmge|tc}) and|
|000050f0| 20 66 75 6e 63 74 69 6f | 6e 73 20 66 6f 72 20 73 | functio|ns for s|
|00005100| 74 61 6e 64 61 72 64 0a | 70 72 69 6d 69 74 69 76 |tandard.|primitiv|
|00005110| 65 20 74 79 70 65 73 20 | 28 65 2e 67 2e 20 7b 5c |e types |(e.g. {\|
|00005120| 74 74 20 52 65 61 64 72 | 65 61 6c 7d 29 20 69 73 |tt Readr|eal}) is|
|00005130| 20 7b 5c 65 6d 20 6e 6f | 74 7d 20 64 65 64 75 63 | {\em no|t} deduc|
|00005140| 65 64 2c 0a 61 6e 64 20 | 74 68 65 20 67 65 6e 65 |ed,.and |the gene|
|00005150| 72 61 74 69 6f 6e 20 6f | 66 20 74 68 65 73 65 20 |ration o|f these |
|00005160| 66 75 6e 63 74 69 6f 6e | 73 20 6d 75 73 74 20 62 |function|s must b|
|00005170| 65 20 72 65 71 75 65 73 | 74 65 64 20 65 78 70 6c |e reques|ted expl|
|00005180| 69 63 69 74 6c 79 2e 0a | 5c 73 65 63 74 69 6f 6e |icitly..|\section|
|00005190| 7b 53 65 70 61 72 61 74 | 65 20 63 6f 6d 70 69 6c |{Separat|e compil|
|000051a0| 61 74 69 6f 6e 7d 0a 5c | 6c 61 62 65 6c 7b 73 65 |ation}.\|label{se|
|000051b0| 63 3a 73 65 70 63 6f 6d | 70 7d 0a 46 6f 72 20 7b |c:sepcom|p}.For {|
|000051c0| 5c 70 61 73 63 61 6c 7d | 20 63 6f 6d 70 69 6c 65 |\pascal}| compile|
|000051d0| 72 73 20 74 68 61 74 20 | 73 75 70 70 6f 72 74 20 |rs that |support |
|000051e0| 73 65 70 61 72 61 74 65 | 20 63 6f 6d 70 69 6c 61 |separate| compila|
|000051f0| 74 69 6f 6e 20 73 6f 6d | 65 20 73 70 65 63 69 61 |tion som|e specia|
|00005200| 6c 0a 74 65 6d 70 6c 61 | 74 65 20 66 69 6c 65 73 |l.templa|te files|
|00005210| 20 61 72 65 20 61 76 61 | 69 6c 61 62 6c 65 3a 20 | are ava|ilable: |
|00005220| 7b 5c 74 74 20 70 61 73 | 63 6f 64 65 2e 68 74 7d |{\tt pas|code.ht}|
|00005230| 20 61 6e 64 20 7b 5c 74 | 74 20 70 61 73 6c 69 62 | and {\t|t paslib|
|00005240| 2e 68 74 7d 2e 0a 54 68 | 65 73 65 20 66 69 6c 65 |.ht}..Th|ese file|
|00005250| 73 20 63 6f 6e 74 61 69 | 6e 20 7b 5c 74 74 20 65 |s contai|n {\tt e|
|00005260| 78 74 65 72 6e 61 6c 7d | 20 64 65 63 6c 61 72 61 |xternal}| declara|
|00005270| 74 69 6f 6e 73 20 66 6f | 72 20 74 68 65 20 63 6f |tions fo|r the co|
|00005280| 64 65 20 69 6e 20 7b 5c | 74 74 20 70 61 73 63 6f |de in {\|tt pasco|
|00005290| 64 65 2e 70 74 7d 0a 61 | 6e 64 20 7b 5c 74 74 20 |de.pt}.a|nd {\tt |
|000052a0| 70 61 73 6c 69 62 2e 70 | 74 7d 20 72 65 73 70 65 |paslib.p|t} respe|
|000052b0| 63 74 69 76 65 6c 79 2e | 0a 4f 6e 6c 79 20 66 6f |ctively.|.Only fo|
|000052c0| 72 20 74 68 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |r the de|finition|
|000052d0| 73 20 74 68 61 74 20 68 | 61 76 65 20 62 65 65 6e |s that h|ave been|
|000052e0| 20 72 65 71 75 65 73 74 | 65 64 20 75 73 69 6e 67 | request|ed using|
|000052f0| 20 7b 5c 74 74 20 77 61 | 6e 74 64 65 66 73 7d 0a | {\tt wa|ntdefs}.|
|00005300| 64 65 63 6c 61 72 61 74 | 69 6f 6e 73 20 77 69 6c |declarat|ions wil|
|00005310| 6c 20 62 65 20 67 65 6e | 65 72 61 74 65 64 2e 0a |l be gen|erated..|
|00005320| 46 6f 72 20 65 78 61 6d | 70 6c 65 2c 20 61 6e 20 |For exam|ple, an |
|00005330| 65 78 74 65 72 6e 61 6c | 20 64 65 63 6c 61 72 61 |external| declara|
|00005340| 74 69 6f 6e 20 66 6f 72 | 20 7b 5c 74 74 20 74 6d |tion for| {\tt tm|
|00005350| 67 65 74 63 7d 20 77 69 | 6c 6c 20 6c 6f 6f 6b 20 |getc} wi|ll look |
|00005360| 6c 69 6b 65 3a 0a 5c 62 | 65 67 69 6e 7b 76 65 72 |like:.\b|egin{ver|
|00005370| 62 61 74 69 6d 7d 0a 70 | 72 6f 63 65 64 75 72 65 |batim}.p|rocedure|
|00005380| 20 74 6d 67 65 74 63 28 | 20 76 61 72 20 66 3a 20 | tmgetc(| var f: |
|00005390| 74 65 78 74 20 29 3b 20 | 65 78 74 65 72 6e 61 6c |text ); |external|
|000053a0| 3b 0a 5c 65 6e 64 7b 76 | 65 72 62 61 74 69 6d 7d |;.\end{v|erbatim}|
|000053b0| 0a 49 6e 63 6c 75 73 69 | 6f 6e 20 6f 66 20 74 68 |.Inclusi|on of th|
|000053c0| 65 73 65 20 64 65 63 6c | 61 72 61 74 69 6f 6e 73 |ese decl|arations|
|000053d0| 20 69 6e 20 6f 74 68 65 | 72 20 70 61 72 74 73 20 | in othe|r parts |
|000053e0| 6f 66 20 74 68 65 20 70 | 72 6f 67 72 61 6d 20 6d |of the p|rogram m|
|000053f0| 75 73 74 20 62 65 0a 61 | 72 72 61 6e 67 65 64 20 |ust be.a|rranged |
|00005400| 62 79 20 74 68 65 20 74 | 68 65 20 70 72 6f 67 72 |by the t|he progr|
|00005410| 61 6d 6d 65 72 2e 0a 54 | 68 65 20 76 61 72 69 61 |ammer..T|he varia|
|00005420| 62 6c 65 73 20 67 65 6e | 65 72 61 74 65 64 20 62 |bles gen|erated b|
|00005430| 79 20 7b 5c 74 74 20 70 | 61 73 76 61 72 2e 70 74 |y {\tt p|asvar.pt|
|00005440| 7d 20 61 72 65 20 6f 6e | 6c 79 20 6e 65 63 65 73 |} are on|ly neces|
|00005450| 73 61 72 79 0a 66 6f 72 | 20 74 68 65 20 63 6f 64 |sary.for| the cod|
|00005460| 65 20 67 65 6e 65 72 61 | 74 65 64 20 62 79 20 7b |e genera|ted by {|
|00005470| 5c 74 74 20 70 61 73 63 | 6f 64 65 2e 70 74 7d 2c |\tt pasc|ode.pt},|
|00005480| 0a 73 6f 20 74 68 61 74 | 20 74 68 65 79 20 64 6f |.so that| they do|
|00005490| 20 6e 6f 74 20 68 61 76 | 65 20 74 6f 20 62 65 20 | not hav|e to be |
|000054a0| 6d 61 64 65 20 76 69 73 | 69 62 6c 65 20 74 6f 20 |made vis|ible to |
|000054b0| 6f 74 68 65 72 20 66 69 | 6c 65 73 2e 0a 50 72 6f |other fi|les..Pro|
|000054c0| 76 69 64 65 64 20 74 68 | 61 74 20 61 6c 6c 20 7b |vided th|at all {|
|000054d0| 5c 74 74 20 52 65 61 64 | 3c 74 79 70 65 3e 7d 20 |\tt Read|<type>} |
|000054e0| 66 75 6e 63 74 69 6f 6e | 73 20 66 6f 72 20 70 72 |function|s for pr|
|000054f0| 69 6d 69 74 69 76 65 0a | 74 79 70 65 73 20 61 72 |imitive.|types ar|
|00005500| 65 20 69 6e 20 74 68 65 | 20 73 61 6d 65 20 66 69 |e in the| same fi|
|00005510| 6c 65 20 61 73 20 74 68 | 65 20 67 65 6e 65 72 61 |le as th|e genera|
|00005520| 74 65 64 20 63 6f 64 65 | 2c 0a 74 68 65 20 76 61 |ted code|,.the va|
|00005530| 72 69 61 62 6c 65 73 20 | 6f 66 20 7b 5c 74 74 20 |riables |of {\tt |
|00005540| 70 61 73 67 76 61 72 2e | 70 74 7d 20 64 6f 20 6e |pasgvar.|pt} do n|
|00005550| 6f 74 20 68 61 76 65 20 | 74 6f 20 62 65 20 6d 61 |ot have |to be ma|
|00005560| 6b 65 20 76 69 73 69 62 | 6c 65 20 65 69 74 68 65 |ke visib|le eithe|
|00005570| 72 2e 0a 5c 61 70 70 65 | 6e 64 69 78 0a 5c 70 61 |r..\appe|ndix.\pa|
|00005580| 67 65 62 72 65 61 6b 0a | 5c 73 65 63 74 69 6f 6e |gebreak.|\section|
|00005590| 7b 4c 69 73 74 69 6e 67 | 20 6f 66 20 74 68 65 20 |{Listing| of the |
|000055a0| 66 69 6c 65 20 7b 5c 74 | 74 20 64 65 6d 6f 2e 70 |file {\t|t demo.p|
|000055b0| 7d 7d 0a 5c 6c 61 62 65 | 6c 7b 73 65 63 3a 64 65 |}}.\labe|l{sec:de|
|000055c0| 6d 6f 7d 0a 5c 62 65 67 | 69 6e 7b 6c 69 73 74 69 |mo}.\beg|in{listi|
|000055d0| 6e 67 7d 0a 5c 76 65 72 | 62 66 69 6c 65 7b 64 65 |ng}.\ver|bfile{de|
|000055e0| 6d 6f 2e 70 7d 0a 5c 65 | 6e 64 7b 6c 69 73 74 69 |mo.p}.\e|nd{listi|
|000055f0| 6e 67 7d 0a 5c 65 6e 64 | 7b 64 6f 63 75 6d 65 6e |ng}.\end|{documen|
|00005600| 74 7d 0a | |t}. | |
+--------+-------------------------+-------------------------+--------+--------+